diff --git a/Classes/Common/Doc.php b/Classes/Common/Doc.php index 30f72fa9cd..85d44847e8 100644 --- a/Classes/Common/Doc.php +++ b/Classes/Common/Doc.php @@ -478,10 +478,12 @@ public static function &getInstance($location, $settings = [], $forceReload = fa // Sanitize input. $pid = max(intval($settings['storagePid']), 0); + $metadataRepository = GeneralUtility::makeInstance(MetadataRepository::class); + $structureRepository = GeneralUtility::makeInstance(StructureRepository::class); if ($documentFormat == 'METS') { - $instance = new MetsDocument($location, $pid, $xml); + $instance = new MetsDocument($location, $pid, $xml, $metadataRepository, $structureRepository); } elseif ($documentFormat == 'IIIF') { - $instance = new IiifManifest($location, $pid, $iiif); + $instance = new IiifManifest($location, $pid, $iiif, $metadataRepository, $structureRepository); } if ($instance) { @@ -1232,9 +1234,11 @@ protected function _setCPid($value) * * @return void */ - protected function __construct($location, $pid, $preloadedDocument) + protected function __construct($location, $pid, $preloadedDocument, $metadataRepository, $structureRepository) { $this->pid = $pid; + $this->metadataRepository = $metadataRepository; + $this->structureRepository = $structureRepository; $this->setPreloadedDocument($preloadedDocument); $this->init($location); $this->establishRecordId($pid);