r53932 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53931‎ | r53932 | r53933 >
Date:13:14, 29 July 2009
Author:mkroetzsch
Status:deferred
Tags:
Comment:
use property to determine datatype whenever possible (do not rely on datavalue object)
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -487,7 +487,7 @@
488488 // redirects work differently.
489489 $table = '';
490490 $sql = 'p_id=' . $db->addQuotes($pid);
491 - $typeid = ($value === NULL)?$property->getPropertyTypeID():$value->getTypeID();
 491+ $typeid = $property->getPropertyTypeID();
492492 $mode = SMWSQLStore2::getStorageMode($typeid);
493493
494494 switch ($mode) {
@@ -703,9 +703,10 @@
704704
705705 foreach($data->getProperties() as $property) {
706706 $propertyValueArray = $data->getPropertyValues($property);
 707+ $mode = SMWSQLStore2::getStorageMode($property->getPropertyTypeID());
707708 foreach($propertyValueArray as $value) {
708709 if (!$value->isValid()) continue;
709 - switch (SMWSQLStore2::getStorageMode($value->getTypeID())) {
 710+ switch ($mode) {
710711 case SMW_SQL2_REDI2: break; // handled above
711712 case SMW_SQL2_INST2:
712713 $up_inst2[] = array(

Status & tagging log