diff --git a/Classes/Common/MetsDocument.php b/Classes/Common/MetsDocument.php index cf0a9025a..c9ed03cf4 100644 --- a/Classes/Common/MetsDocument.php +++ b/Classes/Common/MetsDocument.php @@ -1119,7 +1119,7 @@ public function getFullText(string $id): string // ... physical structure ... $this->magicGetPhysicalStructure(); // ... fileGrps and check for full text files. - $this->magicGetFileGrps(); + $this->ensureHasFulltextIsSet(); if ($this->hasFulltext) { $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'files'); @@ -1201,9 +1201,12 @@ protected function loadLocation(string $location): bool */ protected function ensureHasFulltextIsSet(): void { - // Are the fileGrps already loaded? - if (!$this->fileGrpsLoaded) { - $this->magicGetFileGrps(); + // Are there any fulltext files available? + if ( + !empty($this->getUseGroup('fileGrpFulltext')) + && array_intersect($this->getUseGroup('fileGrpFulltext'), $this->fileGrps) !== [] + ) { + $this->hasFulltext = true; } } @@ -1364,14 +1367,6 @@ protected function magicGetFileGrps(): array } } } - - // Are there any fulltext files available? - if ( - !empty($this->getUseGroup('fileGrpFulltext')) - && array_intersect($this->getUseGroup('fileGrpFulltext'), $this->fileGrps) !== [] - ) { - $this->hasFulltext = true; - } $this->fileGrpsLoaded = true; } return $this->fileGrps;