Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356507 )

Change subject: Hygiene: MFContentNamespace may not exist
......................................................................

Hygiene: MFContentNamespace may not exist

Since the config variable is not provided by Minerva and we can
not guarantee it will always exist, given Jon has the goal of
seperating Minerva and MobileFrontend, we should ensure this falls
back to 0.

Note this is also used by Special:Nearby.
At a future time, we may want to consider migrating this to core.

Change-Id: I9861d9f18a137ec6d14284c6b53165d723845cc2
---
M includes/skins/SkinMinerva.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/07/356507/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 3439300..2e6c34f 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -634,6 +634,7 @@
        protected function getDiscoveryTools() {
                $config = $this->getMFConfig();
                $menu = new MenuBuilder();
+               $discoveryNamespace = $config->get( 'MFContentNamespace', 0 );
 
                // Home link
                $menu->insert( 'home' )
@@ -649,7 +650,7 @@
                        ->addComponent(
                                $this->msg( 'mobile-frontend-random-button' 
)->escaped(),
                                SpecialPage::getTitleFor( 'Randompage',
-                                       MWNamespace::getCanonicalName( 
$config->get( 'MFContentNamespace' ) ) )->getLocalUrl() .
+                                       MWNamespace::getCanonicalName( 
$discoveryNamespace ) )->getLocalUrl() .
                                                '#/random',
                                MobileUI::iconClass( 'mf-random', 'before' ),
                                [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9861d9f18a137ec6d14284c6b53165d723845cc2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to