do not reuse pointer (call-by-reference) $drag for editing task of questtype ?Drag&Drop? (fixs #160)

This commit is contained in:
oliver 2016-04-15 18:56:58 +02:00
commit 9c9efafc65

View file

@ -256,10 +256,10 @@
if(!is_null($dndField)) if(!is_null($dndField))
{ {
$drags = $this->Dragndrop->getDrags($dndField['quest_id']); $drags = $this->Dragndrop->getDrags($dndField['quest_id']);
foreach($drags as &$drag) foreach($drags as &$d)
{ {
$drag['media'] = $this->Media->getSeminaryMediaById($drag['questmedia_id']); $d['media'] = $this->Media->getSeminaryMediaById($d['questmedia_id']);
$drag['drops'] = array_map(function($d) { return $d['id']; }, $this->Dragndrop->getDropsForDrag($drag['id'])); $d['drops'] = array_map(function($d) { return $d['id']; }, $this->Dragndrop->getDropsForDrag($d['id']));
} }
} }