Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-37374_24' of git://github.com/timhunt/moodle into M…

…OODLE_24_STABLE
  • Loading branch information...
commit d9babbcce11563b698f8a5513159370475bbfd85 2 parents d4c4b84 + 4dcede5
Dan Poltawski danpoltawski authored
2  question/type/edit_question_form.php
View
@@ -481,7 +481,7 @@ public function set_data($question) {
if (is_array($extraquestionfields) && !empty($question->options)) {
array_shift($extraquestionfields);
foreach ($extraquestionfields as $field) {
- if (isset($question->options->$field)) {
+ if (property_exists($question->options->$field)) {
$question->$field = $question->options->$field;
}
}
15 question/type/questiontypebase.php
View
@@ -454,21 +454,12 @@ public function save_question_options($question) {
$options->$questionidcolname = $question->id;
}
foreach ($extraquestionfields as $field) {
- if (!isset($question->$field)) {
- $result = new stdClass();
- $result->error = "No data for field $field when saving " .
- $this->name() . ' question id ' . $question->id;
- return $result;
+ if (property_exists($question->$field)) {
+ $options->$field = $question->$field;
}
- $options->$field = $question->$field;
}
- if (!$DB->{$function}($question_extension_table, $options)) {
- $result = new stdClass();
- $result->error = 'Could not save question options for ' .
- $this->name() . ' question id ' . $question->id;
- return $result;
- }
+ $DB->{$function}($question_extension_table, $options);
}
$extraanswerfields = $this->extra_answer_fields();
Please sign in to comment.
Something went wrong with that request. Please try again.