From: Timo Tijhof Date: Tue, 30 Aug 2016 23:36:28 +0000 (-0700) Subject: OutputPage: Ensure setupSkinUserCss() always applies to headElement() X-Git-Tag: 1.31.0-rc.0~5776^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/%7B%7B%20url_for%28%27vote%27%2C%20idvote=vote.voteid%29%20%7D%7D?a=commitdiff_plain;h=ee52872baf75d4101e4e5810cb3f6b5844907759;p=lhc%2Fweb%2Fwiklou.git OutputPage: Ensure setupSkinUserCss() always applies to headElement() Follows-up 80e5b160e0, which had to move this call out of the headElement() and buildCssLinks() methods as it was no longer allowed to modify the module queue after it was created. It was moved to OutputPage::output(), right before Skin::outputPage() is called, which ends up calling headElement(). The point in time was effectively unchanged for page views. However for the caller in ApiParse() this meant setupSkinUserCss() no longer got called at all as it never calls output(), but instead calls headElement() directly. Move it to getRlClient(), which is where we set all other OutputPage-specific things relating to module loading already. * For page views this has no impact. * For ApiParse it means headElement(), which calls getRlClient(), will once again include skin stylesheets. Bug: T144301 Change-Id: I5fd4a27fb2d70b98ce9161dc050788d8ac364110 --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 1083687fb2..5aaa47454d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2303,7 +2303,6 @@ class OutputPage extends ContextSource { // Hook that allows last minute changes to the output page, e.g. // adding of CSS or Javascript by extensions. Hooks::run( 'BeforePageDisplay', [ &$this, &$sk ] ); - $this->getSkin()->setupSkinUserCss( $this ); try { $sk->outputPage(); @@ -2675,6 +2674,7 @@ class OutputPage extends ContextSource { 'user.styles', 'user.cssprefs', ] ); + $this->getSkin()->setupSkinUserCss( $this ); // Prepare exempt modules for buildExemptModules() $exemptGroups = [ 'site' => [], 'noscript' => [], 'private' => [], 'user' => [] ];