Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php |
— | — | @@ -130,7 +130,9 @@ |
131 | 131 | $wgParser->getOutput()->addHeadItem( $script ); |
132 | 132 | } else { |
133 | 133 | $wgOut->addScript( $script ); |
134 | | - $wgOut->addParserOutputNoText( $wgParser->getOutput() ); |
| 134 | + if ($wgParser->getOutput()) { |
| 135 | + $wgOut->addParserOutputNoText( $wgParser->getOutput() ); |
| 136 | + } |
135 | 137 | } |
136 | 138 | |
137 | 139 | // Finally, set the page title - for MW <= 1.16, this has to be |
Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php |
— | — | @@ -253,10 +253,12 @@ |
254 | 254 | * only a page formula exists). |
255 | 255 | */ |
256 | 256 | function formHTML( $form_def, $form_submitted, $source_is_page, $form_id = null, $existing_page_content = null, $page_name = null, $page_name_formula = null, $is_query = false, $embedded = false ) { |
257 | | - global $wgRequest, $wgUser; |
| 257 | + global $wgRequest, $wgUser, $wgOut; |
258 | 258 | global $sfgTabIndex; // used to represent the current tab index in the form |
259 | 259 | global $sfgFieldNum; // used for setting various HTML IDs |
260 | 260 | |
| 261 | + wfProfileIn( __METHOD__ ); |
| 262 | + |
261 | 263 | // initialize some variables |
262 | 264 | $sfgTabIndex = 1; |
263 | 265 | $sfgFieldNum = 1; |
— | — | @@ -1417,7 +1419,11 @@ |
1418 | 1420 | if ( $form_submitted ) { |
1419 | 1421 | $javascript_text = ''; |
1420 | 1422 | } |
1421 | | - |
| 1423 | + |
| 1424 | + $wgOut -> addParserOutputNoText( $parser->getOutput() ); |
| 1425 | + |
| 1426 | + wfProfileOut( __METHOD__ ); |
| 1427 | + |
1422 | 1428 | return array( $form_text, $javascript_text, $data_text, $form_page_title, $generated_page_name ); |
1423 | 1429 | } |
1424 | 1430 | |
Index: trunk/extensions/SemanticForms/libs/SemanticForms.js |
— | — | @@ -355,10 +355,12 @@ |
356 | 356 | var showOnSelectVals = sfgShowOnSelect[this.attr("id")]; |
357 | 357 | var instanceWrapperDiv = null; |
358 | 358 | } |
359 | | - for ( var i = 0; i < showOnSelectVals.length; i++ ) { |
360 | | - var options = showOnSelectVals[i][0]; |
361 | | - var div_id = showOnSelectVals[i][1]; |
362 | | - showDivIfSelected(options, div_id, inputVal, instanceWrapperDiv); |
| 359 | + if ( showOnSelectVals !== undefined ) { |
| 360 | + for ( var i = 0; i < showOnSelectVals.length; i++ ) { |
| 361 | + var options = showOnSelectVals[i][0]; |
| 362 | + var div_id = showOnSelectVals[i][1]; |
| 363 | + showDivIfSelected(options, div_id, inputVal, instanceWrapperDiv); |
| 364 | + } |
363 | 365 | } |
364 | 366 | } |
365 | 367 | |