Bug 11797: fix odd number of elements in hash warning (MARC21)
This was discovered when someone triggered an authority search on an authority record that was missing what is assumed the default subfield for a given field. It, however, also can be triggered in an OPAC authority search by looking at the record that lacks the default subfield for a given field. TEST PLAN --------- 1) Create an authority record with 180$x and NOT 180$v. See C4::AuthoritiesMarc::BuildSummary in the 1.. foreach loop for known tags and default values. The default subfields are the first letter of the $subfields_to_report string. 2) Trigger the bug: Method 1: /cgi-bin/koha/opac-authoritiesdetail.pl?authid=# Where # is the authority id of your tweaked record. The error occurs in Normal view. Method 2: Home -> Cataloging -> + New record -> Click the 'Tag Editor' on 100$a Editing of $a to $b and back may be required. 3) Notice there is an error log entry. 4) Apply the patch 5) Attempt to trigger the bug again 6) That specific error log entry is not generated. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Could generate the warning with a missing 151$a with both methods. No warning anymore after applying this patch. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
parent
f2b655dfab
commit
129bc32811
1 changed files with 4 additions and 2 deletions
|
@ -1044,15 +1044,17 @@ sub BuildSummary {
|
|||
$subfields_to_report = 'vxyz';
|
||||
}
|
||||
if ($subfields_to_report) {
|
||||
my $hemain = $field->subfield( substr($subfields_to_report, 0, 1) );
|
||||
push @authorized, {
|
||||
heading => $field->as_string($subfields_to_report),
|
||||
hemain => $field->subfield( substr($subfields_to_report, 0, 1) ),
|
||||
hemain => $hemain,
|
||||
field => $tag,
|
||||
};
|
||||
} else {
|
||||
my $hemain = $field->subfield( 'a' );
|
||||
push @authorized, {
|
||||
heading => $field->as_string(),
|
||||
hemain => $field->subfield('a'),
|
||||
hemain => $hemain,
|
||||
field => $tag,
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue