Skip to content
Snippets Groups Projects
Commit c079d8fb authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Return an empty array when concat is true and there are no matches.

parent d02a4d68
Branches
Tags
No related merge requests found
......@@ -509,7 +509,7 @@ class SolrMarc extends SolrDefault
// Loop through all subfields, collecting results that match the whitelist;
// note that it is important to retain the original MARC order here!
$allSubfields = $currentField->getSubfields();
if (count($allSubfields) > 0) {
if (!empty($allSubfields)) {
foreach ($allSubfields as $currentSubfield) {
if (in_array($currentSubfield->getCode(), $subfields)) {
// Grab the current subfield value and act on it if it is
......@@ -523,7 +523,7 @@ class SolrMarc extends SolrDefault
}
// Send back the data in a different format depending on $concat mode:
return $concat ? [implode($separator, $matches)] : $matches;
return $concat && $matches ? [implode($separator, $matches)] : $matches;
}
/**
......
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