r77403 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77402‎ | r77403 | r77404 >
Date:22:26, 28 November 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r77402 - applying similar change to the other parser hooks. Although not obviously needed, there is no reason to make the stuff break on special pages
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Concept.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Declare.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Set.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SetRecurringEvent.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Show.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Concept.php
@@ -72,7 +72,15 @@
7373 ( $concept_docu ? "<p>$concept_docu</p>" : '' ) .
7474 '<pre>' . str_replace( '[', '&#x005B;', $concept_text ) . "</pre>\n</div>";
7575
76 - SMWOutputs::commitToParser( $parser );
 76+ // Starting from MW 1.16, there is a more suited method available: Title::isSpecialPage
 77+ if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
 78+ global $wgOut;
 79+ SMWOutputs::commitToOutputPage( $wgOut );
 80+ }
 81+ else {
 82+ SMWOutputs::commitToParser( $parser );
 83+ }
 84+
7785 return $result;
7886 }
7987
Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Set.php
@@ -35,7 +35,6 @@
3636 }
3737 }
3838
39 - SMWOutputs::commitToParser( $parser ); // not obviously required, but let us be sure
4039 return '';
4140 }
4241
Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SetRecurringEvent.php
@@ -40,7 +40,14 @@
4141 SMWParseData::addProperty( $property_name, $date_str, false, $parser, true );
4242 }
4343
44 - SMWOutputs::commitToParser( $parser ); // Not obviously required, but let us be sure.
 44+ // Starting from MW 1.16, there is a more suited method available: Title::isSpecialPage
 45+ if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
 46+ global $wgOut;
 47+ SMWOutputs::commitToOutputPage( $wgOut );
 48+ }
 49+ else {
 50+ SMWOutputs::commitToParser( $parser );
 51+ }
4552 }
4653
4754 /**
Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Declare.php
@@ -74,7 +74,15 @@
7575 // @todo Save as metadata
7676 }
7777
78 - SMWOutputs::commitToParser( $parser ); // Not obviously required, but let us be sure.
 78+ // Starting from MW 1.16, there is a more suited method available: Title::isSpecialPage
 79+ if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
 80+ global $wgOut;
 81+ SMWOutputs::commitToOutputPage( $wgOut );
 82+ }
 83+ else {
 84+ SMWOutputs::commitToParser( $parser );
 85+ }
 86+
7987 return '';
8088 }
8189
Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_Show.php
@@ -37,7 +37,15 @@
3838 $result = smwfEncodeMessages( array( wfMsgForContent( 'smw_iq_disabled' ) ) );
3939 }
4040
41 - SMWOutputs::commitToParser( $parser );
 41+ // Starting from MW 1.16, there is a more suited method available: Title::isSpecialPage
 42+ if ( $wgTitle->getNamespace() == NS_SPECIAL ) {
 43+ global $wgOut;
 44+ SMWOutputs::commitToOutputPage( $wgOut );
 45+ }
 46+ else {
 47+ SMWOutputs::commitToParser( $parser );
 48+ }
 49+
4250 return $result;
4351 }
4452

Follow-up revisions

RevisionCommit summaryAuthorDate
r77509Follow up to r77403 - added forgotten globalsjeroendedauw20:59, 30 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77402Fixed script loading issue with #info on special pagesjeroendedauw22:20, 28 November 2010

Status & tagging log