http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97484

Revision: 97484
Author:   jeroendedauw
Date:     2011-09-19 13:07:26 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
fix compat w/ SMW 1.6.2

Modified Paths:
--------------
    trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php

Modified: trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php
===================================================================
--- trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php     
2011-09-19 13:07:04 UTC (rev 97483)
+++ trunk/extensions/SemanticCompoundQueries/SCQ_QueryProcessor.php     
2011-09-19 13:07:26 UTC (rev 97484)
@@ -53,7 +53,7 @@
                $query_result = new SCQQueryResult( 
$next_result->getPrintRequests(), new SMWQuery(), $results, smwfGetStore() );
                
                if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
-                       $other_params = parent::getProcessedParams( 
$other_params );
+                       $other_params = parent::getProcessedParams( 
$other_params, $next_result->getPrintRequests() );
                }
                
                return self::getResultFromQueryResult(
@@ -165,13 +165,19 @@
        protected static function getQueryResultFromQueryString( $querystring, 
array $params, $extraprintouts, $outputmode, $context = 
SMWQueryProcessor::INLINE_QUERY ) {
                wfProfileIn( 'SCQQueryProcessor::getQueryResultFromQueryString' 
);
                
+               if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
+                       $params = self::getProcessedParams( $params, 
$extraprintouts );
+               }
+               
                $query  = self::createQuery( $querystring, $params, $context, 
null, $extraprintouts );
                $query_result = smwfGetStore()->getQueryResult( $query );
+               
                foreach ( $query_result->getResults() as $wiki_page ) {
                        $wiki_page->display_options = $params;
                }
 
                wfProfileOut( 
'SCQQueryProcessor::getQueryResultFromQueryString' );
+               
                return $query_result;
        }
        
@@ -190,7 +196,13 @@
        protected static function getResultFromQueryResult( SCQQueryResult 
$res, array $params, $outputmode, $context = SMWQueryProcessor::INLINE_QUERY, 
$format = '' ) {
                wfProfileIn( 'SCQQueryProcessor::getResultFromQueryResult' );
 
-               $format = self::getResultFormat( $params );
+               if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
+                       $format = $params['format'];
+               }
+               else {
+                       $format = self::getResultFormat( $params );
+               }
+               
                $printer = self::getResultPrinter( $format, $context, $res );
                $result = $printer->getResult( $res, $params, $outputmode );
                


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to