r97737 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97736‎ | r97737 | r97738 >
Date:14:35, 21 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixed compat w/ SMW 1.6.2 and later
Modified paths:
  • /trunk/extensions/SemanticDrilldown/SemanticDrilldown.php (modified) (history)
  • /trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php
@@ -1058,24 +1058,30 @@
10591059 } else {
10601060 $query = new SMWQuery();
10611061 }
1062 - if ( array_key_exists( 'format', $params ) ) {
1063 - $format = $params['format'];
1064 - } else {
1065 - $format = 'category';
 1062+ if ( !array_key_exists( 'format', $params ) ) {
 1063+ $params['format'] = 'category';
10661064 }
 1065+
10671066 if ( array_key_exists( 'mainlabel', $params ) ) {
10681067 $mainlabel = $params['mainlabel'];
10691068 } else {
10701069 $mainlabel = '';
10711070 }
 1071+
10721072 $r = $this->addSemanticResultWrapper( $dbr, $res, $num, $query, $mainlabel, $printouts );
1073 - $printer = SMWQueryProcessor::getResultPrinter( $format, SMWQueryProcessor::SPECIAL_PAGE, $r );
 1073+ $printer = SMWQueryProcessor::getResultPrinter( $params['format'], SMWQueryProcessor::SPECIAL_PAGE, $r );
10741074
1075 - $prresult = $printer->getResult( $r, $params, SMW_OUTPUT_HTML );
1076 - if ( is_array( $prresult ) )
1077 - $prtext = $prresult[0];
1078 - else
1079 - $prtext = $prresult;
 1075+ if ( version_compare( SMW_VERSION, '1.6.1', '>' ) ) {
 1076+ $params = SMWQueryProcessor::getProcessedParams( $params );
 1077+ }
 1078+
 1079+ $prresult = $printer->getResult(
 1080+ $r,
 1081+ $params,
 1082+ SMW_OUTPUT_HTML
 1083+ );
 1084+
 1085+ $prtext = is_array( $prresult ) ? $prresult[0] : $prresult;
10801086
10811087 SMWOutputs::commitToOutputPage( $out );
10821088
Index: trunk/extensions/SemanticDrilldown/SemanticDrilldown.php
@@ -13,7 +13,7 @@
1414
1515 if ( !defined( 'MEDIAWIKI' ) ) die();
1616
17 -define( 'SD_VERSION', '0.8.3' );
 17+define( 'SD_VERSION', '0.8.4 alpha' );
1818
1919 $wgExtensionCredits[defined( 'SEMANTIC_EXTENSION_TYPE' ) ? 'semantic' : 'specialpage'][] = array(
2020 'path' => __FILE__,