diff options
| -rw-r--r-- | lib/models/Courseware/Instance.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/models/Courseware/Instance.php b/lib/models/Courseware/Instance.php index 921dcf4..ad7b873 100644 --- a/lib/models/Courseware/Instance.php +++ b/lib/models/Courseware/Instance.php @@ -570,7 +570,6 @@ class Instance { if (!$formatter) { $formatter = function ($row) { - unset($row['id']); return \Courseware\Block::build($row, false); }; } @@ -581,7 +580,7 @@ class Instance * all blocks belonging to these elements. */ $sql = $this->recursiveGetStructuralElementsQuery( - "SELECT DISTINCT st.`id`, b.* + "SELECT DISTINCT st.`id` AS structural_id, b.* FROM structural_tree st JOIN `cw_containers` c ON c.`structural_element_id` = st.`id` @@ -594,7 +593,8 @@ class Instance $data = []; foreach ($statement as $row) { - $structuralElementId = $row['id']; + $structuralElementId = $row['structural_id']; + unset($row['structural_id']); if (!isset($data[$structuralElementId])) { $data[$structuralElementId] = []; |
