r53935 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53934‎ | r53935 | r53936 >
Date:14:11, 29 July 2009
Author:yaron
Status:deferred
Tags:
Comment:
Added error-checking when initializing special properties
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.inc
@@ -12,9 +12,12 @@
1313 static function initProperties() {
1414 global $sfgContLang;
1515 $sf_props = $sfgContLang->getPropertyLabels();
16 - SMWPropertyValue::registerProperty('_SF_DF', '__spf', $sf_props[SF_SP_HAS_DEFAULT_FORM], true);
17 - SMWPropertyValue::registerProperty('_SF_AF', '__spf', $sf_props[SF_SP_HAS_ALTERNATE_FORM], true);
18 - SMWPropertyValue::registerProperty('_SF_CP', '__spf', $sf_props[SF_SP_CREATES_PAGES_WITH_FORM], true);
 16+ if (array_key_exists(SF_SP_HAS_DEFAULT_FORM, $sf_props))
 17+ SMWPropertyValue::registerProperty('_SF_DF', '__spf', $sf_props[SF_SP_HAS_DEFAULT_FORM], true);
 18+ if (array_key_exists(SF_SP_HAS_ALTERNATE_FORM, $sf_props))
 19+ SMWPropertyValue::registerProperty('_SF_AF', '__spf', $sf_props[SF_SP_HAS_ALTERNATE_FORM], true);
 20+ if (array_key_exists(SF_SP_CREATES_PAGES_WITH_FORM, $sf_props))
 21+ SMWPropertyValue::registerProperty('_SF_CP', '__spf', $sf_props[SF_SP_CREATES_PAGES_WITH_FORM], true);
1922 // also initialize hardcoded English values, if it's a non-English-language wiki
2023 SMWPropertyValue::registerProperty('_SF_DF_BACKUP', '__spf', 'Has default form', true);
2124 SMWPropertyValue::registerProperty('_SF_AF_BACKUP', '__spf', 'Has alternate form', true);

Status & tagging log