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

Revision: 97908
Author:   jeroendedauw
Date:     2011-09-23 11:51:04 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
fixed some issues; these should really be addressed by making usage of the 
query processor in general somewhat sane :)

Modified Paths:
--------------
    trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
    trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php

Modified: 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php
===================================================================
--- 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php    
    2011-09-23 11:48:41 UTC (rev 97907)
+++ 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_QueryUIHelper.php    
    2011-09-23 11:51:04 UTC (rev 97908)
@@ -348,8 +348,20 @@
        public function execute() {
                $errors = array();
                if ( $this->queryString != '' ) {
-                       $query = SMWQueryProcessor::createQuery( 
$this->queryString, $this->parameters,
-                               SMWQueryProcessor::SPECIAL_PAGE , 
$this->parameters['format'], $this->printOuts );
+                       // FIXME: this is a hack
+                       SMWQueryProcessor::addThisPrinteout( $this->printOuts, 
$this->parameters );
+                       $params = SMWQueryProcessor::getProcessedParams( 
$this->parameters, $this->printOuts );
+                       $this->parameters['format'] = $params['format'];
+                       $this->params = $params;
+                       
+                       $query = SMWQueryProcessor::createQuery(
+                               $this->queryString, 
+                               $params,
+                               SMWQueryProcessor::SPECIAL_PAGE,
+                               $this->parameters['format'],
+                               $this->printOuts
+                       );
+                       
                        $res = smwfGetStore()->getQueryResult( $query );
                        $this->queryResult = $res;
 
@@ -429,7 +441,7 @@
                $resultMime = $printer->getMimeType( $res );
 
                if ( $res->getCount() > 0 ) {
-                       $queryResult = $printer->getResult( $res, 
$this->parameters, SMW_OUTPUT_HTML );
+                       $queryResult = $printer->getResult( $res, 
$this->params, SMW_OUTPUT_HTML );
 
                        if ( is_array( $queryResult ) ) {
                                $result .= $queryResult[0];

Modified: 
trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php
===================================================================
--- trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php   
2011-09-23 11:48:41 UTC (rev 97907)
+++ trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php   
2011-09-23 11:51:04 UTC (rev 97908)
@@ -370,6 +370,8 @@
                if ( array_key_exists( 'order', $this->m_params ) ) 
$urlArgs['order'] = $this->m_params['order'];
 
                if ( $this->m_querystring != '' ) {
+                       // FIXME: this is a hack
+                       SMWQueryProcessor::addThisPrinteout( 
$this->m_printouts, $this->m_params );
                        $params = SMWQueryProcessor::getProcessedParams( 
$this->m_params, $this->m_printouts );
                        $this->m_params['format'] = $params['format'];
                        


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

Reply via email to