r53537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53536‎ | r53537 | r53538 >
Date:09:40, 20 July 2009
Author:minuteelectron
Status:deferred
Tags:
Comment:
* Re-add localisation code accidentally removed (with temporary hack).
* Exception => MwException.
* Couple of FIXMEs.
Modified paths:
  • /trunk/extensions/Wikidata/App.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/App.php
@@ -81,6 +81,9 @@
8282 $wgDefinedMeaningPageTitlePrefix = "";
8383 $wgExpressionPageTitlePrefix = "Multiple meanings";
8484 require_once("$IP/extensions/Wikidata/OmegaWiki/GotoSourceTemplate.php");
 85+
 86+$dir = dirname( __FILE__ ) . '/';
 87+$wgExtensionMessagesFiles['Wikidata'] = $dir . 'SpecialLanguages.i18n.php';
8588
8689 $wgGotoSourceTemplates = array(5 => $swissProtGotoSourceTemplate);
8790
@@ -195,11 +198,7 @@
196199 function initializeWikidata() {
197200 global $wgExtensionPreferences, $wdSiteContext, $wgPropertyToColumnFilters;
198201
199 - # Add extension messages to the cache (initialize it here because they will be needed below)
200 - global $wgMessageCache, $wdMessages;
201 - foreach( $wdMessages as $language => $translations ) {
202 - $wgMessageCache->addMessages( $translations, $language );
203 - }
 202+ wfLoadExtensionMessages( 'Wikidata' );
204203
205204 $dbr =& wfGetDB(DB_MASTER);
206205 $dbr->query("SET NAMES utf8");
@@ -216,10 +215,9 @@
217216 'size' => 10,
218217 'options' => $datasetarray
219218 );
220 -
221 - global
222 - $messageCacheOK;
223 -
 219+
 220+ # FIXME: Temporary hack to ensure OmegaWikiAttributes does not exception.
 221+ global $messageCacheOK;
224222 $messageCacheOK = true;
225223
226224 global
Index: trunk/extensions/Wikidata/OmegaWiki/OmegaWikiAttributes.php
@@ -325,10 +325,10 @@
326326
327327 public function __get($key) {
328328 if (!$this->setup())
329 - throw new Exception("OmegaWikiAttributes accessed, but was not properly initialized");
 329+ throw new MwException("OmegaWikiAttributes accessed, but was not properly initialized");
330330 $attributes=&$this->attributes;
331331 if (!array_key_exists($key, $attributes)) {
332 - throw new Exception("Key does not exist: " . $key);
 332+ throw new MwException("Key does not exist: " . $key);
333333 }
334334 return $attributes[$key];
335335 }
Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php
@@ -28,6 +28,7 @@
2929 }
3030
3131 function createPage() {
 32+ # FIXME: This method is no longer present.
3233 $expressionNameSpaceId = Namespace::getIndexForName('expression');
3334 wfDebug("NS ID: $expressionNameSpaceId \n");
3435 return createPage($expressionNameSpaceId, getPageTitle($this->spelling));
@@ -768,6 +769,7 @@
769770 }
770771
771772 function addDefinedMeaning($definingExpressionId) {
 773+ # FIXME: This method is no longer present.
772774 $definedMeaningNameSpaceId = Namespace::getIndexForName('definedmeaning');
773775 $dc=wdGetDataSetContext();
774776

Status & tagging log