Skip to content

Mantis #47003: Fix learning sequence title & description not updated correctly - #10981

Closed
mBeym wants to merge 1 commit into
ILIAS-eLearning:release_10from
mBeym:bugfix/ilias10/lso/fix-object-title-and-description-not-properly-updated
Closed

mBeym wants to merge 1 commit into
ILIAS-eLearning:release_10from
mBeym:bugfix/ilias10/lso/fix-object-title-and-description-not-properly-updated

Conversation

@mBeym

@mBeym mBeym commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Fixes: https://mantis.ilias.de/view.php?id=47003

If accepted should be picked into release_11 & trunk

@kevenClausenKPG

Copy link
Copy Markdown
Contributor

Hey, thanks a lot for reporting the bug and for taking the time to provide a pull request — that’s really appreciated!

I’ve reviewed the PR and would like to suggest a small change. The variable
$property_title_and_description = $data['object']; seems to be unnecessary and could be removed.

Instead, it should be sufficient to add the following two lines right before the $lso->update() call:

$lso->setTitle($data['object']->getTitle());
$lso->setDescription($data['object']->getDescription());

Could you please adjust the PR accordingly?
Thanks again for your contribution!

@kergomard

Copy link
Copy Markdown
Contributor

Hi @kevenClausenKPG

This is not correct. Please avoid using the setters in ILIASObject. They are only there for legacy reasons and I will remove them as soon as I get around to it.

Best,
@kergomard

@dkippKPG

dkippKPG commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

I've dug a bit into this:
$lso->update() calls its parent, ilContainer->update(), where the translation table is updated. But without using the ilObject setters before, $this->getTitle() etc. are not up to date.

So I see two possibilities:

Override getTitle() and getLongDescription() in ilObjLearningSequence, e.g.

diff --git a/components/ILIAS/LearningSequence/classes/class.ilObjLearningSequence.php b/components/ILIAS/LearningSequence/classes/class.ilObjLearningSequence.php
index fd2b7d57f1c..5cd52e9902b 100755
--- a/components/ILIAS/LearningSequence/classes/class.ilObjLearningSequence.php
+++ b/components/ILIAS/LearningSequence/classes/class.ilObjLearningSequence.php
@@ -634,4 +634,16 @@ class ilObjLearningSequence extends ilContainer
         $ret = $gui->showPage();
         return $ret;
     }
+
+    public function getTitle(): string
+    {
+        $props = $this->getObjectProperties();
+        return $props->getPropertyTitleAndDescription()->getTitle() ?? parent::getTitle();
+    }
+
+    public function getLongDescription(): string
+    {
+        $props = $this->getObjectProperties();
+        return $props->getPropertyTitleAndDescription()->getDescription() ?? parent::getLongDescription();
+    }
 }

Or 2., which does not seem very good: handle updating the translation again after $lso->update(), e.g.

diff --git a/components/ILIAS/LearningSequence/classes/Settings/class.ilObjLearningSequenceSettingsGUI.php b/components/ILIAS/LearningSequence/classes/Settings/class.ilObjLearningSequenceSettingsGUI.php
index f7f1dc021e0..dba0461c067 100755
--- a/components/ILIAS/LearningSequence/classes/Settings/class.ilObjLearningSequenceSettingsGUI.php
+++ b/components/ILIAS/LearningSequence/classes/Settings/class.ilObjLearningSequenceSettingsGUI.php
@@ -230,6 +230,11 @@ class ilObjLearningSequenceSettingsGUI

         $lso->update();

+        $trans = $lso->getObjectTranslation();
+        $trans->setDefaultTitle($data['object']->getTitle());
+        $trans->setDefaultDescription($data['object']->getDescription());
+        $trans->save();
+
         $this->tpl->setOnScreenMessage("success", $this->lng->txt("msg_obj_modified"), true);
         $this->ctrl->redirect($this);
         return null;

I've tested both and both work.

What are your opinions, @kergomard and @mBeym, on this?

@dkippKPG

Copy link
Copy Markdown
Contributor

I've opened #12403 with a simpler fix that works without the setters

@mBeym
mBeym deleted the bugfix/ilias10/lso/fix-object-title-and-description-not-properly-updated branch November 11, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants