r88194 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88193‎ | r88194 | r88195 >
Date:16:27, 15 May 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added check so that a null parser output doesn't lead to warnings
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_RunQuery.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
@@ -84,8 +84,12 @@
8585 global $wgUser, $wgTitle, $wgOut;
8686 $wgParser->mOptions = new ParserOptions();
8787 $wgParser->mOptions->initialiseFromUser( $wgUser );
 88+ // @TODO - fix RunQuery's parsing so that this check
 89+ // isn't needed.
 90+ if ( $wgParser->getOutput() == null ) {
 91+ $headItems = array();
8892 // method was added in MW 1.16
89 - if ( method_exists( $wgParser->getOutput(), 'getHeadItems' ) ) {
 93+ } elseif ( method_exists( $wgParser->getOutput(), 'getHeadItems' ) ) {
9094 $headItems = $wgParser->getOutput()->getHeadItems();
9195 } else {
9296 $headItems = $wgParser->getOutput()->mHeadItems;