Skip to content
Snippets Groups Projects
Commit c6709030 authored by Dorian Merz's avatar Dorian Merz
Browse files

refs #14573

* bugfix in MungerInjectionFactory
* checks for empty IndexShards config to avoid abort on error
parent febee5e0
No related merge requests found
...@@ -57,13 +57,15 @@ class MungerInjectionFactory implements DelegatorFactoryInterface { ...@@ -57,13 +57,15 @@ class MungerInjectionFactory implements DelegatorFactoryInterface {
} }
); );
} }
$shards = $searchConfig->IndexShards->toArray(); if (!empty($searchConfig->IndexShards)) {
if ($excludedShards = $searchConfig->ShardPreferences->on_user_search_only) { $shards = $searchConfig->IndexShards->toArray();
$shards = array_diff_key($shards, array_flip(explode(',', $excludedShards))); if ($excludedShards = $searchConfig->ShardPreferences->on_user_search_only) {
} $shards = array_diff_key($shards, array_flip(explode(',', $excludedShards)));
if (!empty($shards)) { }
$this->shards_to_register = $shards; if (!empty($shards)) {
$e->attach('VuFind\Search', 'pre', [$this, 'registerShards']); $this->shards_to_register = $shards;
$e->attach('VuFind\Search', 'pre', [$this, 'registerShards']);
}
} }
return $instance; return $instance;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment