Skip to content

Commit

Permalink
KohaRest: Fix getConfig for holdings.
Browse files Browse the repository at this point in the history
There was a mistake that dropped everything else but itemLimit from the Holdings configuration.
  • Loading branch information
EreMaijala committed Sep 9, 2024
1 parent 7c7c9d0 commit ba0e9dc
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions module/VuFind/src/VuFind/ILS/Driver/KohaRest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1807,17 +1807,15 @@ public function getConfig($function, $params = [])
'default_sort' => '+due_date',
];
} elseif ('Holdings' === $function) {
$limitByType = $this->config['Holdings']['itemLimitByType'] ?? [];
$type = '';
if ($limitByType) {
$config = $this->config['Holdings'] ?? [];
if ($limitByType = $this->config['Holdings']['itemLimitByType'] ?? null) {
$biblio = $this->getBiblio($params['id']);
$type = $biblio['item_type'];
if ($typeLimit = $limitByType[$type] ?? null) {
$config['itemLimit'] = $typeLimit;
}
}
return [
'itemLimit' => $limitByType[$type]
?? $this->config['Holdings']['itemLimit']
?? null,
];
return $config;
}

return $this->config[$function] ?? false;
Expand Down

0 comments on commit ba0e9dc

Please sign in to comment.