Permalink
Browse files

MDL-10767 - set values of checkboxes correctly merged from HEAD

  • Loading branch information...
1 parent d5e89c7 commit 255b8281b664565b82f57bed50b50195817226fc danmarsden committed Aug 27, 2008
Showing with 18 additions and 0 deletions.
  1. +18 −0 mod/scorm/mod_form.php
View
@@ -243,5 +243,23 @@ function validation($data) {
}
}
+ //need to translate the "options" field.
+ function set_data($default_values) {
+ if (is_object($default_values)) {
+ if (!empty($default_values->options)) {
+ $options = explode(',', $default_values->options);
+ foreach ($options as $option) {
+ $opt = explode('=', $option);
+ if (isset($opt[1])) {
+ $default_values->$opt[0] = $opt[1];
+ }
+ }
+ }
+ $default_values = (array)$default_values;
+ }
+ $this->data_preprocessing($default_values);
+ parent::set_data($default_values); //never slashed for moodleform_mod
+ }
+
}
?>

0 comments on commit 255b828

Please sign in to comment.