Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php |
— | — | @@ -32,6 +32,7 @@ |
33 | 33 | |
34 | 34 | function printPage( $form_name, $embedded = false ) { |
35 | 35 | global $wgOut, $wgRequest, $sfgFormPrinter, $wgParser, $sfgRunQueryFormAtTop; |
| 36 | + global $wgUser, $wgTitle; |
36 | 37 | |
37 | 38 | // Get contents of form-definition page. |
38 | 39 | $form_title = Title::makeTitleSafe( SF_NS_FORM, $form_name ); |
— | — | @@ -80,9 +81,11 @@ |
81 | 82 | $sfgFormPrinter->formHTML( $form_definition, $form_submitted, $is_text_source, $form_article->getID(), $edit_content, null, null, true, $embedded ); |
82 | 83 | $text = ""; |
83 | 84 | |
| 85 | + // Get the text of the results. |
| 86 | + $resultsText = ''; |
| 87 | + |
84 | 88 | if ( $form_submitted ) { |
85 | | - global $wgUser, $wgTitle, $wgOut; |
86 | | - $wgParser->mOptions = ParserOptions::newFromUser( $wgUser ); |
| 89 | + |
87 | 90 | // @TODO - fix RunQuery's parsing so that this check |
88 | 91 | // isn't needed. |
89 | 92 | if ( $wgParser->getOutput() == null ) { |
— | — | @@ -93,11 +96,8 @@ |
94 | 97 | foreach ( $headItems as $key => $item ) { |
95 | 98 | $wgOut->addHeadItem( $key, "\t\t" . $item . "\n" ); |
96 | 99 | } |
97 | | - } |
98 | 100 | |
99 | | - // Get the text of the results. |
100 | | - $resultsText = ''; |
101 | | - if ( $form_submitted ) { |
| 101 | + $wgParser->mOptions = ParserOptions::newFromUser( $wgUser ); |
102 | 102 | $resultsText = $wgParser->parse( $data_text, $wgTitle, $wgParser->mOptions )->getText(); |
103 | 103 | } |
104 | 104 | |