aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/courseware_controller.php
diff options
context:
space:
mode:
authorRon Lucke <lucke@elan-ev.de>2023-12-11 10:37:55 +0000
committerRon Lucke <lucke@elan-ev.de>2023-12-11 10:37:55 +0000
commitf2767008ffcf723bc73a4ea8781b31f23c2b68e5 (patch)
tree55d6c4b96b65f42545d9a624263089f5f5cb06a4 /app/controllers/courseware_controller.php
parent47e23c2e78b4cc099dc6217fa0827a033ef0dc9f (diff)
TIC #3111
Closes #3111 Merge request studip/studip!2295
Diffstat (limited to 'app/controllers/courseware_controller.php')
-rw-r--r--app/controllers/courseware_controller.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/courseware_controller.php b/app/controllers/courseware_controller.php
index ddee584..91fc9c8 100644
--- a/app/controllers/courseware_controller.php
+++ b/app/controllers/courseware_controller.php
@@ -35,10 +35,10 @@ abstract class CoursewareController extends AuthenticatedController
if ($last_element) {
$last_element_unit = $last_element->findUnit();
}
- if (isset($last_element_unit) && $last_element_unit->id === $unit->id) {
+ if (isset($last_element_unit) && $last_element_unit->id === $unit->id && $last_element_unit->hasRootLayout()) {
$this->entry_element_id = $last_element->id;
} else {
- $this->entry_element_id = $unit->structural_element_id;
+ $this->entry_element_id = $unit->findOrCreateFirstElement()->id;
}
if ($this->entry_element_id) {
$last_element_item = $context === 'user' ? 'global' : $rangeId;