From ee52872baf75d4101e4e5810cb3f6b5844907759 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 30 Aug 2016 16:36:28 -0700 Subject: [PATCH] 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 --- includes/OutputPage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' => [] ]; -- 2.20.1