Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions src/CompoundQueryProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,8 @@ public static function queryAndMergeResults( $queryParams, $otherParams ) {

$queryResult = new CompoundQueryResult( $printRequests, new Query(), $results, smwfGetStore() );

if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
self::addThisPrintout( $printRequests, $otherParams );
$otherParams = self::getProcessedParams( $otherParams, $printRequests );
}
self::addThisPrintout( $printRequests, $otherParams );
$otherParams = self::getProcessedParams( $otherParams, $printRequests );

return [ $queryResult, $otherParams ];
}
Expand Down Expand Up @@ -217,10 +215,8 @@ protected static function mergeSMWPrintRequests( $printRequests1, $printRequests
* @return QueryResult
*/
protected static function getQueryResultFromQueryString( $querystring, array $params, $extraPrintouts, $context = QueryProcessor::INLINE_QUERY ) {
if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
QueryProcessor::addThisPrintout( $extraPrintouts, $params );
$params = self::getProcessedParams( $params, $extraPrintouts, false );
}
QueryProcessor::addThisPrintout( $extraPrintouts, $params );
$params = self::getProcessedParams( $params, $extraPrintouts, false );

$query = self::createQuery( $querystring, $params, $context, null, $extraPrintouts );

Expand All @@ -232,23 +228,15 @@ protected static function getQueryResultFromQueryString( $querystring, array $pa
* except that formats of type 'debug' and 'count' aren't handled.
*
* @param CompoundQueryResult $res
* @param array $params These need to be the result of a list fed to getProcessedParams as of SMW 1.6.2
* @param array $params These need to be the result of a list fed to getProcessedParams
* @param $outputmode
* @param $context
* @param string $format
*
* @return string
*/
protected static function getResultFromQueryResult( CompoundQueryResult $res, array $params, $outputmode, $context = QueryProcessor::INLINE_QUERY, $format = '' ) {
if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
$format = $params['format'];

if ( version_compare( SMW_VERSION, '1.7.2', '>' ) ) {
$format = $format->getValue();
}
} else {
$format = self::getResultFormat( $params );
}
$format = $params['format']->getValue();

$printer = self::getResultPrinter( $format, $context );
$result = $printer->getResult( $res, $params, $outputmode );
Expand Down