MediaWiki r64448 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r64447‎ | r64448 (on ViewVC)‎ | r64449 >
Date:18:43, 31 March 2010
Author:demon
Status:ok
Tags:
Comment:
Change $wgMetaNamespace to "MyWiki" right before showing the form. It defaults to $wgSiteName which defaults to "MediaWiki". This is not a valid namespace.
Modified paths:

Diff [purge]

Index: branches/new-installer/phase3/maintenance/language/messages.inc
===================================================================
--- branches/new-installer/phase3/maintenance/language/messages.inc	(revision 64447)
+++ branches/new-installer/phase3/maintenance/language/messages.inc	(revision 64448)
@@ -3285,6 +3285,7 @@
 		'config-ns-generic',
 		'config-ns-site-name',
 		'config-ns-other',
+		'config-ns-other-default',
 		'config-project-namespace-help',
 		'config-ns-invalid',
 		'config-admin-default-username',
Index: branches/new-installer/phase3/includes/installer/WebInstaller.php
===================================================================
--- branches/new-installer/phase3/includes/installer/WebInstaller.php	(revision 64447)
+++ branches/new-installer/phase3/includes/installer/WebInstaller.php	(revision 64448)
@@ -1087,6 +1087,11 @@
 		$js = 'enableControlArray("config__NamespaceType_other", ["config_wgMetaNamespace"])';
 		$attribs = array( 'onclick' => $js );
 
+		// Set wgMetaNamespace to something valid before we show the form.
+		// $wgMetaNamespace defaults to $wgSiteName which is 'MediaWiki'
+		$metaNS = $this->getVar( 'wgMetaNamespace' );
+		$this->setVar( 'wgMetaNamespace', wfMsgNoTrans( 'config-ns-other-default' ) );
+
 		$this->addHTML( 
 			$this->parent->getTextBox( array(
 				'var' => 'wgSitename',
@@ -1143,6 +1148,9 @@
 			) )
 		);
 
+		// Restore the default value
+		$this->setVar( 'wgMetaNamespace', $metaNS );
+
 		$this->endForm();
 		return 'output';
 	}
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php
===================================================================
--- branches/new-installer/phase3/languages/messages/MessagesEn.php	(revision 64447)
+++ branches/new-installer/phase3/languages/messages/MessagesEn.php	(revision 64448)
@@ -4472,6 +4472,7 @@
 'config-ns-generic'               => 'Project',
 'config-ns-site-name'             => 'Same as the wiki name: $1',
 'config-ns-other'                 => 'Other (please specify)',
+'config-ns-other-default'         => 'MyWiki',
 'config-project-namespace-help'   => 'Following Wikipedia\'s example, many wikis keep their policy and help pages separate from their content pages, in a "<strong>project namespace</strong>". 
 All page titles in this namespace start with a certain prefix, which you can specify here. 
 Traditionally, this prefix is derived from the name of the wiki, but it cannot contain punctuation characters such as # or :',

Status & tagging log

Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox