diff --git a/Services/Container/classes/class.ilContainerGUI.php b/Services/Container/classes/class.ilContainerGUI.php index ce7f40851ce3..1e3adb6a024c 100644 --- a/Services/Container/classes/class.ilContainerGUI.php +++ b/Services/Container/classes/class.ilContainerGUI.php @@ -1759,11 +1759,10 @@ public function pasteObject(): void // get subnodes of top nodes $subnodes[$ref_id] = $this->tree->getSubTree($top_node); } - // now move all subtrees to new location foreach ($subnodes as $key => $subnode) { // first paste top_node.... - $obj_data = ilObjectFactory::getInstanceByRefId($ref_id); + $obj_data = ilObjectFactory::getInstanceByRefId($key); $new_ref_id = $obj_data->createReference(); $obj_data->putInTree($this->requested_ref_id); $obj_data->setPermissions($this->requested_ref_id);