Skip to content

Commit

Permalink
[BUGFIX] Fix checking if file group exists (#1235)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Meyer <[email protected]>
  • Loading branch information
beatrycze-volk and sebastian-meyer committed May 31, 2024
1 parent 0f88edc commit ad3d8de
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Classes/Controller/PageViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ protected function getFulltext(int $page): array
$fileGrpsFulltext = GeneralUtility::trimExplode(',', $this->extConf['files']['fileGrpFulltext']);
while ($fileGrpFulltext = array_shift($fileGrpsFulltext)) {
$physicalStructureInfo = $this->document->getCurrentDocument()->physicalStructureInfo[$this->document->getCurrentDocument()->physicalStructure[$page]];
$fileId = $physicalStructureInfo['files'][$fileGrpFulltext];
if (!empty($fileId)) {
$file = $this->document->getCurrentDocument()->getFileInfo($fileId);
$files = $physicalStructureInfo['files'];
if (!empty($files[$fileGrpFulltext])) {
$file = $this->document->getCurrentDocument()->getFileInfo($files[$fileGrpFulltext]);
$fulltext['url'] = $file['location'];
if ($this->settings['useInternalProxy']) {
$this->configureProxyUrl($fulltext['url']);
Expand Down Expand Up @@ -227,9 +227,9 @@ protected function getImage(int $page): array
while ($fileGrpImages = array_pop($fileGrpsImages)) {
// Get image link.
$physicalStructureInfo = $this->document->getCurrentDocument()->physicalStructureInfo[$this->document->getCurrentDocument()->physicalStructure[$page]];
$fileId = $physicalStructureInfo['files'][$fileGrpImages];
if (!empty($fileId)) {
$file = $this->document->getCurrentDocument()->getFileInfo($fileId);
$files = $physicalStructureInfo['files'];
if (!empty($files[$fileGrpImages])) {
$file = $this->document->getCurrentDocument()->getFileInfo($files[$fileGrpImages]);
$image['url'] = $file['location'];
$image['mimetype'] = $file['mimeType'];

Expand Down

0 comments on commit ad3d8de

Please sign in to comment.