r111949 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111948‎ | r111949 | r111950 >
Date:18:30, 20 February 2012
Author:foxtrott
Status:deferred
Tags:
Comment:
try to fix bug 33606 (SF_RunQuery.php: Argument 3 passed to Parser::parse() must be an instance of ParserOptions, null given)
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_RunQuery.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
@@ -32,6 +32,7 @@
3333
3434 function printPage( $form_name, $embedded = false ) {
3535 global $wgOut, $wgRequest, $sfgFormPrinter, $wgParser, $sfgRunQueryFormAtTop;
 36+ global $wgUser, $wgTitle;
3637
3738 // Get contents of form-definition page.
3839 $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name );
@@ -80,9 +81,11 @@
8182 $sfgFormPrinter->formHTML( $form_definition, $form_submitted, $is_text_source, $form_article->getID(), $edit_content, null, null, true, $embedded );
8283 $text = "";
8384
 85+ // Get the text of the results.
 86+ $resultsText = '';
 87+
8488 if ( $form_submitted ) {
85 - global $wgUser, $wgTitle, $wgOut;
86 - $wgParser->mOptions = ParserOptions::newFromUser( $wgUser );
 89+
8790 // @TODO - fix RunQuery's parsing so that this check
8891 // isn't needed.
8992 if ( $wgParser->getOutput() == null ) {
@@ -93,11 +96,8 @@
9497 foreach ( $headItems as $key => $item ) {
9598 $wgOut->addHeadItem( $key, "\t\t" . $item . "\n" );
9699 }
97 - }
98100
99 - // Get the text of the results.
100 - $resultsText = '';
101 - if ( $form_submitted ) {
 101+ $wgParser->mOptions = ParserOptions::newFromUser( $wgUser );
102102 $resultsText = $wgParser->parse( $data_text, $wgTitle, $wgParser->mOptions )->getText();
103103 }
104104