Skip to content

Commit

Permalink
[FINNA-2917] MARC: Add a check for invalid linked fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Dec 9, 2024
1 parent c836c8d commit 46d58c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions module/Finna/src/Finna/RecordDriver/SolrMarc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,13 @@ protected function getLinkedMarcFieldContents($field, $subfields)
}
$linkage = $marc->parseLinkageField($link);
foreach ($marc->getFields($linkage['field']) as $linkedField) {
if (!is_array($linkedField)) {
$this->logError(
'Invalid linked field: ' . var_export($linkedField, true) . ', record id '
. ($this->fields['id'] ?? '??')
);
continue;
}
$sub6 = $marc->getSubfield($linkedField, '6');
$targetLinkage = $marc->parseLinkageField($sub6);
if (
Expand Down

0 comments on commit 46d58c9

Please sign in to comment.