r86510 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86509‎ | r86510 | r86511 >
Date:17:35, 20 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
fixed ID lookup for type names with spaces
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/dataitems/SMW_DI_Property.php
@@ -202,8 +202,11 @@
203203 $typearray = smwfGetStore()->getPropertyValues( $diWikiPage, new SMWDIProperty( '_TYPE' ) );
204204 if ( count( $typearray ) >= 1 ) { // some types given, pick one (hopefully unique)
205205 $typeString = reset( $typearray );
206 - $this->m_proptypeid = ( $typeString instanceOf SMWDIWikiPage ) ?
207 - SMWDataValueFactory::findTypeID( $typeString->getDBKey() ) : '__err';
 206+ if ( $typeString instanceOf SMWDIWikiPage ) {
 207+ $this->m_proptypeid = SMWDataValueFactory::findTypeID( str_replace( '_', ' ', $typeString->getDBKey() ) );
 208+ } else {
 209+ $this->m_proptypeid = '__err';
 210+ }
208211 } elseif ( count( $typearray ) == 0 ) { // no type given
209212 $this->m_proptypeid = $smwgPDefaultType;
210213 }

Status & tagging log