Skip to content
Snippets Groups Projects
Commit 36b1ec8a authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #20600 [finc] getURLS: treat URLs independently, based on ind2

parent 26467f0a
Branches
Tags
No related merge requests found
......@@ -127,7 +127,7 @@ trait SolrMarcFincTrait
foreach ($fieldsToCheck as $field => $subfields) {
$urls = $this->getMarcRecord()->getFields($field);
$resultsPerIsil = [];
$resultsPerIndicator2 = [];
if ($urls) {
foreach ($urls as $url) {
$isil = $url->getSubfield('9');
......@@ -172,7 +172,7 @@ trait SolrMarcFincTrait
}
}
$resultsPerIsil[$isil][] = [
$resultsPerIndicator2[$indicator2][$isil][] = [
'url' => $address,
'desc' => $desc,
'indicators' => $indicator1 . $indicator2,
......@@ -188,14 +188,16 @@ trait SolrMarcFincTrait
}
}
$subresult = $this->extractUrls($resultsPerIsil);
$subresult = array_map([$this, 'extractUrls'], $resultsPerIndicator2);
if (!empty($subresult)) {
foreach ($subresult as $current) {
// If entry doesn't exist so far write
// to return variable.
if (!in_array($current, $retVal)) {
$retVal[] = $current;
foreach ($subresult as $perIndicator2) {
foreach ($perIndicator2 as $current) {
// If entry doesn't exist so far write
// to return variable.
if (!in_array($current, $retVal)) {
$retVal[] = $current;
}
}
}
}
......
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