r24166 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24165‎ | r24166 | r24167 >
Date:15:43, 16 July 2007
Author:mkroetzsch
Status:old
Tags:
Comment:
Fix for getting id of nary properties
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_DataValueFactory.php
@@ -189,7 +189,11 @@
190190 static public function getPropertyObjectTypeID(Title $property) {
191191 $propertyname = $property->getText();
192192 if (array_key_exists($propertyname, SMWDataValueFactory::$m_typelabels)) {
193 - return SMWDataValueFactory::$m_typelabels[$propertyname]->getXSDValue();
 193+ if (SMWDataValueFactory::$m_typelabels[$propertyname]->isUnary() ) {
 194+ return SMWDataValueFactory::$m_typelabels[$propertyname]->getXSDValue();
 195+ } else {
 196+ return '__nry';
 197+ }
194198 } else {
195199 return SMWDataValueFactory::newPropertyObjectValue($property)->getTypeID(); // this also triggers caching
196200 }

Status & tagging log