r90085 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90084‎ | r90085 | r90086 >
Date:21:05, 14 June 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
address bug 29393
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php
@@ -597,8 +597,9 @@
598598 $query->jointable = $proptable->name;
599599
600600 if ( $property->isInverse() ) { // see if we can support inverses by inverting the proptable data
601 - if ( ( count( $proptable->objectfields ) == 1 ) && ( reset( $proptable->objectfields ) == 'p' ) ) {
602 - $query->joinfield = $query->alias . '.' . reset( array_keys( $proptable->objectfields ) );
 601+ if ( ( count( $proptable->objectfields ) == 1 ) && ( $proptable->objectfields[0] == 'p' ) ) {
 602+ $keys = array_keys( $proptable->objectfields );
 603+ $query->joinfield = $query->alias . '.' . $keys[0];
603604 $objectfields = array( 's_id' => 'p' );
604605 $valueindex = $labelindex = 3; // should normally not change, but let's be strict
605606 } else { // no inverses supported for this property, stop here