r74994 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74993‎ | r74994 | r74995 >
Date:02:10, 19 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Adding support for queries done in templates on special pages
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Ask.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Ask.php
@@ -23,7 +23,7 @@
2424 * @param Parser $parser
2525 */
2626 public static function render( Parser &$parser ) {
27 - global $smwgQEnabled, $smwgIQRunningNumber;
 27+ global $smwgQEnabled, $smwgIQRunningNumber, $wgTitle;
2828
2929 if ( $smwgQEnabled ) {
3030 $smwgIQRunningNumber++;
@@ -37,7 +37,13 @@
3838 $result = smwfEncodeMessages( array( wfMsgForContent( 'smw_iq_disabled' ) ) );
3939 }
4040
41 - SMWOutputs::commitToParser( $parser );
 41+ if ( $wgTitle->isSpecialPage() ) {
 42+ global $wgOut;
 43+ SMWOutputs::commitToOutputPage( $wgOut );
 44+ }
 45+ else {
 46+ SMWOutputs::commitToParser( $parser );
 47+ }
4248
4349 return $result;
4450 }

Status & tagging log