Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_QueryResult.php |
— | — | @@ -71,11 +71,6 @@ |
72 | 72 | * @param boolean $furtherRes |
73 | 73 | */ |
74 | 74 | public function __construct( array $printRequests, SMWQuery $query, array $results, SMWStore $store, $furtherRes = false ) { |
75 | | - // FIXME: this is a evil hack treating the symptom of something going wrong closer to the store |
76 | | -// if ( count( $results ) > 0 && $results[0]->getInterwiki() === SMW_SQL2_SMWBORDERIW ) { |
77 | | -// unset( $results[0] ); |
78 | | -// } |
79 | | - |
80 | 75 | $this->mResults = $results; |
81 | 76 | reset( $this->mResults ); |
82 | 77 | $this->mPrintRequests = $printRequests; |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -390,14 +390,16 @@ |
391 | 391 | $qobj->where, 'SMW::getQueryResult', $sql_options ); |
392 | 392 | |
393 | 393 | $qr = array(); |
394 | | - $count = 0; |
| 394 | + $count = 0; // the number of fetched results ( != number of valid results in array $qr) |
395 | 395 | $prs = $query->getDescription()->getPrintrequests(); |
396 | 396 | |
397 | 397 | while ( ( $count < $query->getLimit() ) && ( $row = $this->m_dbs->fetchObject( $res ) ) ) { |
398 | 398 | $count++; |
399 | | - $v = new SMWDIWikiPage( $row->t, $row->ns, $row->iw, $row->so ); |
400 | | - $qr[] = $v; |
401 | | - $this->m_store->cacheSMWPageID( $row->id, $row->t, $row->ns, $row->iw, $row->so ); |
| 399 | + if ( $row->iw == '' || $row->iw{0} != ':' ) { |
| 400 | + $v = new SMWDIWikiPage( $row->t, $row->ns, $row->iw, $row->so ); |
| 401 | + $qr[] = $v; |
| 402 | + $this->m_store->cacheSMWPageID( $row->id, $row->t, $row->ns, $row->iw, $row->so ); |
| 403 | + } |
402 | 404 | } |
403 | 405 | |
404 | 406 | if ( $this->m_dbs->fetchObject( $res ) ) { |