r42054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42053‎ | r42054 | r42055 >
Date:20:14, 13 October 2008
Author:dale
Status:old
Tags:
Comment:
fixed null value check
Modified paths:
  • /trunk/extensions/MetavidWiki/includes/MV_Index.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/includes/MV_Index.php
@@ -619,14 +619,16 @@
620620 $propTitle = Title::newFromText( $propKey, SMW_NS_PROPERTY );
621621 $smwProps = $smwStore->getPropertyValues( $rowTitle, $propTitle );
622622 // just a temp hack .. we need to think about this abstraction a bit..
623 - if($propKey=='speech_by' || $propKey=='spoken_by'){
624 - $v = current( $smwProps );
625 - $row->spoken_by = $v->getXSDValue();
626 - }else if($propKey=='bill'){
627 - $row->bills=array();
628 - foreach($smwProps as $v){
629 - $row->bills[$v->getXSDValue()] = true;
630 - }
 623+ if(count($smwProps)!=0){
 624+ if($propKey=='speech_by' || $propKey=='spoken_by'){
 625+ $v = current( $smwProps );
 626+ $row->spoken_by = $v->getXSDValue();
 627+ }else if($propKey=='bill'){
 628+ $row->bills=array();
 629+ foreach($smwProps as $v){
 630+ $row->bills[$v->getXSDValue()] = true;
 631+ }
 632+ }
631633 }
632634 }
633635 }

Status & tagging log