Skip to content

Commit

Permalink
Move set up of fulltext to correct function
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Dec 19, 2024
1 parent 7f30972 commit d1b4b0e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Classes/Common/MetsDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d1b4b0e

Please sign in to comment.