diff --git a/Classes/Common/Solr/Solr.php b/Classes/Common/Solr/Solr.php index acd6e3a7f..c6eea82e4 100644 --- a/Classes/Common/Solr/Solr.php +++ b/Classes/Common/Solr/Solr.php @@ -301,7 +301,7 @@ public static function getInstance($core = null): Solr if (!empty($core)) { // Check if there is an instance in the registry already. if ( - is_object(self::$registry[$core]) + array_key_exists($core, self::$registry) && self::$registry[$core] instanceof self ) { // Return singleton instance if available. diff --git a/Classes/Controller/PageViewController.php b/Classes/Controller/PageViewController.php index 5cb106079..aba4ad07f 100644 --- a/Classes/Controller/PageViewController.php +++ b/Classes/Controller/PageViewController.php @@ -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']); @@ -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'];