Skip to content

Commit

Permalink
fixed 38221: When switching from custom to reused title in the settin…
Browse files Browse the repository at this point in the history
…gs of ContainerReferences, the title is not immediately updated
  • Loading branch information
alex40724 committed Oct 23, 2023
1 parent c6c15b4 commit 77aa8b6
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,6 @@ protected function loadPropertiesFromSettingsForm(ilPropertyFormGUI $form): bool
$ok = true;
$access = $DIC->access();

$this->object->setTitleType((int) $form->getInput('title_type'));
if ((int) $form->getInput('title_type') === ilContainerReference::TITLE_TYPE_CUSTOM) {
$this->object->setTitle($form->getInput('title'));
}

// check access
if (
!$access->checkAccess('visible', '', (int) $form->getInput('target_id'))
Expand All @@ -318,6 +313,14 @@ protected function loadPropertiesFromSettingsForm(ilPropertyFormGUI $form): bool
ilObject::_lookupObjId((int) $form->getInput('target_id'))
);

// set title after target id, so that the title can be reused immediately
$this->object->setTitleType((int) $form->getInput('title_type'));
if ((int) $form->getInput('title_type') === ilContainerReference::TITLE_TYPE_CUSTOM) {
$this->object->setTitle($form->getInput('title'));
} elseif ((int) $form->getInput('title_type') === ilContainerReference::TITLE_TYPE_REUSE) {
$this->object->setTitle(ilObject::_lookupTitle($this->object->getTargetId()));
}

return $ok;
}

Expand Down

0 comments on commit 77aa8b6

Please sign in to comment.