aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/StructuralElement.php
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-07-21 15:06:34 +0000
committerElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-07-21 15:06:34 +0000
commit100e67f2a70c740245dffb28fb3d111968b921b6 (patch)
tree8e5240c4acdb4ddafce99903771ad6be63335d33 /lib/models/Courseware/StructuralElement.php
parent830ead71e21d660a7b2c93d882fd1adc4b20984d (diff)
fix order during export and linking, fixes #2959 and #1361
Closes #2959 and #1361 Merge request studip/studip!1991
Diffstat (limited to 'lib/models/Courseware/StructuralElement.php')
-rw-r--r--lib/models/Courseware/StructuralElement.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/models/Courseware/StructuralElement.php b/lib/models/Courseware/StructuralElement.php
index 42b8760..11227d2 100644
--- a/lib/models/Courseware/StructuralElement.php
+++ b/lib/models/Courseware/StructuralElement.php
@@ -1045,9 +1045,7 @@ SQL;
private function linkChildren(User $user, StructuralElement $newElement): void
{
- $children = self::findBySQL('parent_id = ?', [$this->id]);
-
- foreach ($children as $child) {
+ foreach ($this->children as $child) {
$child->link($user, $newElement);
}
}
@@ -1104,9 +1102,8 @@ SQL;
private function getChildrenPdfExport(int $depth, bool $with_children, $user, $doc)
{
- $children = self::findBySQL('parent_id = ?', [$this->id]);
$depth++;
- foreach ($children as $child) {
+ foreach ($this->children as $child) {
$child->getElementPdfExport($depth, $with_children, $user, $doc);
}
}