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

refs #16117 [master] fix in parsing of VD-numbers

* adds IND1 = 7
parent b2cd789f
No related merge requests found
...@@ -295,8 +295,10 @@ trait SolrMarcFincTrait ...@@ -295,8 +295,10 @@ trait SolrMarcFincTrait
*/ */
public function getIndexOfGermanPrints() public function getIndexOfGermanPrints()
{ {
// define a false indicator // if IND1 === 8 we have an unspecified type of number
$lookfor_indicator = '8'; // if IND1 === 7 the "Source of number or code" is specified in subfield $2
// however, we don't need to check that since we have a begins-with check on the field's data
$lookfor_indicators = ['7','8'];
$retval = []; $retval = [];
$fields = $this->getMarcRecord()->getFields('024'); $fields = $this->getMarcRecord()->getFields('024');
...@@ -305,11 +307,11 @@ trait SolrMarcFincTrait ...@@ -305,11 +307,11 @@ trait SolrMarcFincTrait
} }
foreach ($fields as $field) { foreach ($fields as $field) {
// ->getIndicator(position) // ->getIndicator(position)
$subjectrow = $field->getIndicator('1'); if (in_array($field->getIndicator('1'),$lookfor_indicators)) {
if ($subjectrow == $lookfor_indicator) {
if ($subfield = $field->getSubfield('a')) { if ($subfield = $field->getSubfield('a')) {
if (preg_match('/^VD/i', $subfield->getData()) > 0) { $data = $subfield->getData();
$retval[] = $subfield->getData(); if (stripos($data,'VD') === 0) {
$retval[] = $data;
} }
} }
} }
......
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