From 08de37719d8601207ed37c4ea1c8715c2b8e7107 Mon Sep 17 00:00:00 2001 From: Marius Hoch Date: Sun, 16 Mar 2014 03:48:41 +0100 Subject: [PATCH] Don't try to inline load ext.scribunto on mobile This module doesn't exist on mobile, so don't try to load it there (which will produce an exception). Bug: 59808 Change-Id: Ifad7edb508c1f740a109e8f5c1656e4c7841ab13 --- common/Hooks.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/common/Hooks.php b/common/Hooks.php index bd3ae8fd..af4a5310 100644 --- a/common/Hooks.php +++ b/common/Hooks.php @@ -364,10 +364,17 @@ WIKI; * @param $parserOutput ParserOutput */ public static function parserOutputHook( $outputPage, $parserOutput ) { + // Only run the following if we're not on mobile as ext.scribunto doesn't work on mobile. Bug 59808 + if ( $outputPage->getTarget() === 'mobile' ) { + return; + } + $outputPage->addModules( 'ext.scribunto' ); - $outputPage->addInlineScript( 'mw.loader.using("ext.scribunto", function() {' . - Xml::encodeJsCall( 'mw.scribunto.setErrors', array( $parserOutput->scribunto_errors ) ) - . '});' ); + $outputPage->addInlineScript( + 'mw.loader.using("ext.scribunto", function() {' . + Xml::encodeJsCall( 'mw.scribunto.setErrors', array( $parserOutput->scribunto_errors ) ) + . '});' + ); } /**