Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1607,10 +1607,17 @@ public function updateCustomIcon(): void

if ($subtype && $subtype->getIconIdentifier()) {
$src = $this->type_repository->getIconPathFS($subtype);
if ($src === null || $src === '') {
// The subtype references an icon id that no longer resolves to a file, so delete it
$customIcon->remove();
return;
}

//This is a horrible hack to allow Flysystem/LocalFilesystem to read the file.
$tmp = 'ico_' . $this->getId();
copy($src, \ilFileUtils::getDataDir() . '/temp/' . $tmp);
if (!copy($src, ilFileUtils::getDataDir() . '/temp/' . $tmp)) {
return;
}

$customIcon->saveFromTempFileName($tmp);
} else {
Expand Down Expand Up @@ -1909,14 +1916,14 @@ public function statusToRepr(int $status): string

public function hasContentPage(): bool
{
return \ilContainerPage::_exists(self::CP_TYPE, $this->getId());
return ilContainerPage::_exists(self::CP_TYPE, $this->getId());
}
public function createContentPage(): void
{
if ($this->hasContentPage()) {
throw new \LogicException('will not create content page - it already exists.');
throw new LogicException('will not create content page - it already exists.');
}
$new_page_object = new \ilContainerPage();
$new_page_object = new ilContainerPage();
$new_page_object->setId($this->getId());
$new_page_object->setParentId($this->getId());
$new_page_object->createFromXML();
Expand Down
Loading