[Bug 11797] New: auth_finder.pl: Odd number of elements in anonymous hash
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Bug ID: 11797 Summary: auth_finder.pl: Odd number of elements in anonymous hash Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: MARC Authority data support Assignee: gmcharlt@gmail.com Reporter: mtompset@hotmail.com QA Contact: testopia@bugs.koha-community.org While hunting through my live system Koha error logs I found: auth_finder.pl: Odd number of elements in anonymous hash at /usr/share/koha/lib/C4/AuthoritiesMarc.pm line 1037. So, I read the code and wondered what if a tag was missing in the giant if statement? http://www.loc.gov/marc/authority/ad1xx3xx.html lists a 162, but there is no 162, nor is there an else on the giant if statement. Test? I don't know, but the patch that follows should fix it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 25478 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25478&action=edit Bug 11797 - auth_finder.pl: Odd number of elements in anonymous hash Added missing 162 MARC authorities tag and missing else case. If the records are not in a given order the first substring of the previous tag could be not 'a', but only 'a' exists for 162, so the hash would have "hemain => " which triggers the error. That's my theory anyways. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25478|0 |1 is obsolete| | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 25882 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25882&action=edit Bug 11797 - Odd number of elements in hash 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 ... 3) Notice there is an error log entry. 4) Apply the patch 5) Attempt to trigger the bug again 6) Error log entry is not generated. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25882|0 |1 is obsolete| | --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 25884 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25884&action=edit Bug 11797 - Odd number of elements in hash 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25884|0 |1 is obsolete| | --- Comment #4 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 27077 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27077&action=edit Bug 11797 - Odd number of elements in hash 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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #27077|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 27120 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27120&action=edit Bug 11797 - Odd number of elements in hash - UNIMARC I got the same warning for my UNIMARC DB. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion CC| |gmcharlt@gmail.com --- Comment #6 from Galen Charlton <gmcharlt@gmail.com> --- Double-checking: was the MARC21 variant of this patch marked obsolete by mistake? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #27120|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 27133 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27133&action=edit Bug 11797 - Odd number of elements in hash 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 27134 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27134&action=edit Bug 11797 - Odd number of elements in hash - UNIMARC I got the same warning for my UNIMARC DB. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #9 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Can we reset the status of this report? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #10 from M. Tompsett <mtompset@hotmail.com> --- I agree it should be changed. I don't think Jonathan's patch has been signed off, hence the 'Needs Signoff' status. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #11 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master, along with a follow-up to normalize the two approaches taken to remove the warning and a patch that adds unit tests and regression tests. Thanks, Mark and Jonathan! Jonathan: I would be interested in seeing an example of a valid UNIMARC authority that triggers the bug. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11797 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #12 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.10 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org