Skip to content

Commit

Permalink
ContainerReference: fix empty title on creation (32383) (ILIAS-eLearn…
Browse files Browse the repository at this point in the history
  • Loading branch information
schmitz-ilias authored Sep 29, 2023
1 parent 900f006 commit 4882454
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions Services/ContainerReference/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Roadmap

## Short Term

...

## Mid Term

### Listen for changes of target object's title

ContainerReference objects that reuse the title of their target should update their title
when the target does, e.g. via event handling. Currently, different components
handle the rendering of the title of references differently, some looking up
the title of the target and some just using the title of the reference directly from
object_data, leading to inconsistent results when the title of the target is
changed.

## Long Term

...
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ protected function afterSave(ilObject $a_new_object)
$a_new_object->setTitleType($this->form->getInput('title_type'));
if ($this->form->getInput('title_type') == ilContainerReference::TITLE_TYPE_CUSTOM) {
$a_new_object->setTitle($this->form->getInput('title'));
} elseif ($this->form->getInput('title_type') == ilContainerReference::TITLE_TYPE_REUSE) {
$a_new_object->setTitle(ilObject::_lookupTitle($a_new_object->getTargetId()));
}

$a_new_object->update();
Expand Down Expand Up @@ -349,7 +351,7 @@ protected function initForm($a_mode = self::MODE_EDIT)
array_merge(
array($this->getTargetType()),
array("root", "cat", "grp", "fold", "crs")
)
)
);
$repo->setInfo($this->lng->txt($this->getReferenceType() . '_edit_info'));

Expand Down

0 comments on commit 4882454

Please sign in to comment.