r88941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88940‎ | r88941 | r88942 >
Date:22:17, 26 May 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added handling for SMW 1.6
Modified paths:
  • /trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php
@@ -137,11 +137,20 @@
138138 $existing_page_names = array();
139139
140140 foreach ( $result1 as $r1 ) {
141 - $existing_page_names[] = $r1->getWikiValue();
 141+ // SMW 1.6+
 142+ if ( $r1 instanceof SMWDIWikiPage ) {
 143+ $existing_page_names[] = $r1->getDBkey();
 144+ } else {
 145+ $existing_page_names[] = $r1->getWikiValue();
 146+ }
142147 }
143148
144149 foreach ( $result2 as $r2 ) {
145 - $page_name = $r2->getWikiValue();
 150+ if ( $r1 instanceof SMWDIWikiPage ) {
 151+ $page_name = $r2->getDBkey();
 152+ } else {
 153+ $page_name = $r2->getWikiValue();
 154+ }
146155
147156 if ( ! in_array( $page_name, $existing_page_names ) ) {
148157 $result1[] = $r2;

Status & tagging log