Ori.livneh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/62409
Change subject: (Bug 48117) Inline the call to get content model
......................................................................
(Bug 48117) Inline the call to get content model
MWNamespace::getNamespaceContentModel() is not available in MediaWiki 1.20.
Fortunately, the functionality it implements is trivial and easy to inline into
the caller.
Change-Id: Ib7f793c8559233aa1e7a128a03d133795cb06402
---
M engines/LuaCommon/SiteLibrary.php
1 file changed, 9 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Scribunto
refs/changes/09/62409/1
diff --git a/engines/LuaCommon/SiteLibrary.php
b/engines/LuaCommon/SiteLibrary.php
index cc6cdfe..f64e124 100644
--- a/engines/LuaCommon/SiteLibrary.php
+++ b/engines/LuaCommon/SiteLibrary.php
@@ -6,7 +6,7 @@
private $pagesInCategoryCache = array();
function register() {
- global $wgContLang, $wgNamespaceAliases;
+ global $wgContLang, $wgNamespaceAliases,
$wgNamespaceContentModels;
$lib = array(
'loadSiteStats' => array( $this, 'loadSiteStats' ),
@@ -28,6 +28,13 @@
$namespacesByName = array();
foreach ( $wgContLang->getFormattedNamespaces() as $ns
=> $title ) {
$canonical = MWNamespace::getCanonicalName( $ns
);
+
+ if ( isset( $wgNamespaceContentModels[$ns] ) ) {
+ $defaultContentModel =
$wgNamespaceContentModels[$ns];
+ } else {
+ $defaultContentModel = null;
+ }
+
$namespaces[$ns] = array(
'id' => $ns,
'name' => $title,
@@ -40,7 +47,7 @@
'isMovable' => MWNamespace::isMovable(
$ns ),
'isSubject' => MWNamespace::isSubject(
$ns ),
'isTalk' => MWNamespace::isTalk( $ns ),
- 'defaultContentModel' =>
MWNamespace::getNamespaceContentModel( $ns ),
+ 'defaultContentModel' =>
$defaultContentModel,
'aliases' => array(),
);
if ( $ns >= NS_MAIN ) {
--
To view, visit https://gerrit.wikimedia.org/r/62409
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7f793c8559233aa1e7a128a03d133795cb06402
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Scribunto
Gerrit-Branch: REL1_20
Gerrit-Owner: Ori.livneh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits