r72838 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72837‎ | r72838 | r72839 >
Date:04:35, 12 September 2010
Author:yaron
Status:deferred
Tags:
Comment:
Fix so that non-matching values in "show on select" for radiobuttons don't break the Javascript
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormInputs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.php
@@ -914,6 +914,10 @@
915915 $cur_input_ids[] = $enum_input_ids[$option];
916916 }
917917 }
 918+ // If there were no matches to existing radiobutton options, escape
 919+ if ( count( $cur_input_ids ) == 0 ) {
 920+ continue;
 921+ }
918922 $options_str = "['" . implode( "', '", $cur_input_ids ) . "']";
919923 $cur_js_text = "showIfChecked($options_str, '$div_id'); ";
920924 $return_js_text .= $cur_js_text . "\n";

Status & tagging log