jenkins-bot has submitted this change and it was merged.

Change subject: Move efGatherExtensionSetup() to Hooks.php to fix CI breakage
......................................................................


Move efGatherExtensionSetup() to Hooks.php to fix CI breakage

When extension.json is present, Gather.php is not loaded. Thus,
the function does not exist.

> Warning: Invalid argument: function: method 'efGatherExtensionSetup'
> not found in mediawiki/includes/Setup.php on line 671

Change-Id: I55d9e362e3c1bb69c8ec550127d136c5b8838a2b
---
M Gather.php
M includes/Gather.hooks.php
2 files changed, 9 insertions(+), 10 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Gather.php b/Gather.php
index 2a0141d..866e442 100644
--- a/Gather.php
+++ b/Gather.php
@@ -29,15 +29,6 @@
 $wgMessagesDirs['Gather'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['GatherAlias'] = __DIR__ . "/Gather.alias.php";
 
-function efGatherExtensionSetup() {
-       // FIXME: This doesn't do anything as if mobilefrontend is not present
-       // The reported error is "This requires Gather."
-       if ( !defined( 'MOBILEFRONTEND' ) ) {
-               echo "Gather extension requires MobileFrontend.\n";
-               die( -1 );
-       }
-}
-
 // autoload extension classes
 $autoloadClasses = array(
        'Gather\Hooks' => 'Gather.hooks',
@@ -73,11 +64,11 @@
        $wgAutoloadClasses[$className] = __DIR__ . 
"/includes/$classFilename.php";
 }
 
-$wgExtensionFunctions[] = 'efGatherExtensionSetup';
 
 $wgSpecialPages['Gather'] = 'Gather\SpecialGather';
 
 // Hooks
+$wgExtensionFunctions[] = 'Gather\Hooks::onExtensionSetup';
 $wgHooks['MobilePersonalTools'][] = 'Gather\Hooks::onMobilePersonalTools';
 $wgHooks['UnitTestsList'][] = 'Gather\Hooks::onUnitTestsList';
 
diff --git a/includes/Gather.hooks.php b/includes/Gather.hooks.php
index d123ef7..48e7c7e 100644
--- a/includes/Gather.hooks.php
+++ b/includes/Gather.hooks.php
@@ -18,6 +18,14 @@
  *     onRequestContextCreateSkin()
  */
 class Hooks {
+       public static function onExtensionSetup() {
+               // FIXME: This doesn't do anything as if mobilefrontend is not 
present
+               // The reported error is "This requires Gather."
+               if ( !defined( 'MOBILEFRONTEND' ) ) {
+                       echo "Gather extension requires MobileFrontend.\n";
+                       die( -1 );
+               }
+       }
        /**
         * Add collections link in personal tools menu
         * @param array &$items Items array to be added to menu

-- 
To view, visit https://gerrit.wikimedia.org/r/192048
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I55d9e362e3c1bb69c8ec550127d136c5b8838a2b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to