From: Gilles Dubuc Date: Mon, 15 Aug 2016 07:15:45 +0000 (+0200) Subject: Move bottomScripts() call in SkinTemplate X-Git-Tag: 1.31.0-rc.0~6070^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=95fc8a96db6087224370408cd88d717708714a14;p=lhc%2Fweb%2Fwiklou.git Move bottomScripts() call in SkinTemplate SkinTemplateNavigation::SpecialPage in buildContentNavigationUrls() and possibly other hooks are susceptible to adding bottom scripts to the skin's OutputPage. It's safer to add the bottom scripts to the template as late as we can, as doing so will instantiate the rlClient and populate it with the scripts collected at that point. Bug: T87871 Change-Id: I000365a7542167d8531d6984d3a1ef6c362034ab --- diff --git a/includes/skins/SkinTemplate.php b/includes/skins/SkinTemplate.php index e5dc59f35e..278af67e45 100644 --- a/includes/skins/SkinTemplate.php +++ b/includes/skins/SkinTemplate.php @@ -455,7 +455,6 @@ class SkinTemplate extends Skin { $tpl->set( 'indicators', $out->getIndicators() ); $tpl->set( 'sitenotice', $this->getSiteNotice() ); - $tpl->set( 'bottomscripts', $this->bottomScripts() ); $tpl->set( 'printfooter', $this->printSource() ); // Wrap the bodyText with #mw-content-text element $out->mBodytext = $this->wrapHTML( $title, $out->mBodytext ); @@ -508,6 +507,9 @@ class SkinTemplate extends Skin { // See Skin::afterContentHook() for further documentation. $tpl->set( 'dataAfterContent', $this->afterContentHook() ); + // Do this last in case hooks above add bottom scripts + $tpl->set( 'bottomscripts', $this->bottomScripts() ); + return $tpl; }