Skip to content

Commit

Permalink
File: fix creation of metadata (42065)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmitz-ilias authored and chfsx committed Dec 17, 2024
1 parent b911b86 commit b777a3b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions components/ILIAS/File/classes/trait.ilObjFileMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,14 @@ protected function doCreateMetaData(): void
global $DIC;

// add file size and format to LOM
$DIC->learningObjectMetadata()->manipulate($this->getId(), 0, $this->getType())
->prepareCreateOrUpdate($this->getPathToSize(), (string) $this->getFileSize())
// ->prepareCreateOrUpdate($this->getPathToFirstFormat(), $this->getFileType()) // TIDI thwors exception
->prepareCreateOrUpdate($this->getPathToVersion(), (string) $this->getVersion())
->execute();
$manipulator = $DIC->learningObjectMetadata()
->manipulate($this->getId(), 0, $this->getType())
->prepareCreateOrUpdate($this->getPathToSize(), (string) $this->getFileSize())
->prepareCreateOrUpdate($this->getPathToVersion(), (string) $this->getVersion());
if ($this->getFileType() !== '') {
$manipulator = $manipulator->prepareCreateOrUpdate($this->getPathToFirstFormat(), $this->getFileType());
}
$manipulator->execute();
}

protected function beforeMDUpdateListener(string $a_element): bool
Expand Down

0 comments on commit b777a3b

Please sign in to comment.