Skip to content

Commit

Permalink
NOBUG Fixed error happening when restoring missingtype questions if a…
Browse files Browse the repository at this point in the history
…nswers weren't present (cast error)
  • Loading branch information
stronk7 committed Jul 29, 2009
1 parent 4431b5b commit 21ae339
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions question/type/missingtype/edit_missingtype_form.php
Expand Up @@ -27,7 +27,8 @@ function definition_inner(&$mform) {
function set_data($question) {
if (isset($question->options)){
$answers = $question->options->answers;
if (count($answers)) {
$default_values = array();
if (is_array($answers) && count($answers)) {
$key = 0;
foreach ($answers as $answer){
$default_values['answer['.$key.']'] = $answer->answer;
Expand Down Expand Up @@ -84,4 +85,4 @@ function validation($data, $files) {
return $errors;
}
}
?>
?>

0 comments on commit 21ae339

Please sign in to comment.