From: Alex Z Date: Tue, 16 Dec 2008 19:59:37 +0000 (+0000) Subject: Fix for r44676, fix E_NOTICE from having no canonical name associated with a namespac... X-Git-Tag: 1.31.0-rc.0~43929 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=ddde44606bbd734f20df1636f33b5ce1caf9f2f1;p=lhc%2Fweb%2Fwiklou.git Fix for r44676, fix E_NOTICE from having no canonical name associated with a namespace (ns 0), move RELEASE-NOTES entry to API section and clarify. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 37a15fef5d..a0524ca225 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -233,7 +233,6 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 7492) Rights can now be assigned to specific IP addresses and ranges by using $wgAutopromote (new defines: APCOND_ISIP and APCOND_IPINRANGE) * Add a 'change block' link to Special:IPBlockList and Special:Log -* (bug 16672) Add canonical parameter to meta=siteinfo&siprop=namespaces|namespacealiases. === Bug fixes in 1.14 === @@ -531,6 +530,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 16647) list=allcategories, prop=categories don't return "hidden" property for hidden categories * New siprop parameter of 'extensions' to list all installed extensions +* (bug 16672) Include canonical namespace name in meta=siteinfo&siprop=namespaces. === Languages updated in 1.14 === diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index c92272aeda..8c7aee33d9 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -127,7 +127,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { } protected function appendNamespaces( $property ) { - global $wgContLang; + global $wgContLang, $wgCanonicalNamespaceNames; $data = array(); foreach( $wgContLang->getFormattedNamespaces() as $ns => $title ) { @@ -135,7 +135,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { 'id' => $ns ); ApiResult :: setContent( $data[$ns], $title ); - $canonical = Namespace::getCanonicalName( $ns ); + $canonical = isset($wgCanonicalNamespaceNames[$ns]) ? $wgCanonicalNamespaceNames[$ns] : false; if( MWNamespace::hasSubpages( $ns ) ) $data[$ns]['subpages'] = ''; @@ -352,7 +352,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { 'prop' => array( 'Which sysinfo properties to get:', ' "general" - Overall system information', - ' "namespaces" - List of registered namespaces (localized)', + ' "namespaces" - List of registered namespaces and their canonical names', ' "namespacealiases" - List of registered namespace aliases', ' "specialpagealiases" - List of special page aliases', ' "magicwords" - List of magic words and their aliases',