Skip to content

Instantly share code, notes, and snippets.

@ciencia
Last active February 24, 2022 11:23
Show Gist options
  • Save ciencia/23a2b963f12b9251c44300a0bad44b19 to your computer and use it in GitHub Desktop.
Save ciencia/23a2b963f12b9251c44300a0bad44b19 to your computer and use it in GitHub Desktop.
patch MediaWiki extension MobileFrontend reenable JS config var wgCategories on mobile
--- extensions/MobileFrontend/includes/MobileFrontendHooks.php 2022-02-24 11:13:19.276555994 +0000
+++ extensions/MobileFrontend/includes/MobileFrontendHooks.php 2022-02-24 11:14:40.725259992 +0000
@@ -1123,7 +1123,8 @@
$context = $services->getService( 'MobileFrontend.Context' );
if ( $context->shouldDisplayMobileView() ) {
$outreach = $services->getService( 'MobileFrontend.AMC.Outreach' );
- unset( $vars['wgCategories'] );
+ // Remove this to allow gadgets to work
+ //unset( $vars['wgCategories'] );
$vars['wgMFMode'] = $context->isBetaGroupMember() ? 'beta' : 'stable';
$vars['wgMFAmc'] = $userMode->isEnabled();
$vars['wgMFAmcOutreachActive'] = $outreach->isCampaignActive();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment