Skip to content

Commit 61a70ba

Browse files
[BUGFIX] Fixes for runtime issues noticed in tests with main branch (kitodo#1430)
Signed-off-by: Stefan Weil <sw@weilnetz.de> Co-authored-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
1 parent d5cabdb commit 61a70ba

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Classes/Controller/OaiPmhController.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ protected function verbGetRecord()
390390
*/
391391
protected function verbIdentify()
392392
{
393-
$library = $this->libraryRepository->findByUid($this->settings['library']);
393+
$library = $this->libraryRepository->findByUid($this->settings['library'] ?? 0);
394394

395395
$oaiIdentifyInfo = [];
396396

@@ -642,7 +642,12 @@ protected function fetchDocumentSet(): array
642642

643643
$solrQuery .= ' AND timestamp:[' . $from . ' TO ' . $until . ']';
644644

645-
$solr = Solr::getInstance($this->settings['solrcore']);
645+
$solrcore = $this->settings['solrcore'] ?? false;
646+
if (!$solrcore) {
647+
$this->logger->error('Solr core not configured');
648+
return $documentSet;
649+
}
650+
$solr = Solr::getInstance($solrcore);
646651
if (!$solr->ready) {
647652
$this->logger->error('Apache Solr not available');
648653
return $documentSet;

0 commit comments

Comments
 (0)