MDL-25000 backup - prevent calling get_mapping() with empty ids. Yay, 25000!

This commit is contained in:
Eloy Lafuente
2010-11-02 01:05:43 +00:00
parent 25ba71960e
commit d0ff90ed4f
@@ -102,13 +102,13 @@ class restore_qtype_multichoice_plugin extends restore_qtype_plugin {
}
// Map order
foreach (explode(',', $lists[0]) as $id) {
if ($newid = $this->get_mappingid('question_answer', $id)) {
if (!empty($id) && $newid = $this->get_mappingid('question_answer', $id)) {
$orderarr[] = $newid;
}
}
// Map responses
foreach (explode(',', $lists[1]) as $id) {
if ($newid = $this->get_mappingid('question_answer', $id)) {
if (!empty($id) && $newid = $this->get_mappingid('question_answer', $id)) {
$responsesarr[] = $newid;
}
}