[Bug 40883] New: Authorities display fails on unknown 7XX
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Bug ID: 40883 Summary: Authorities display fails on unknown 7XX Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: MARC Authority data support Assignee: koha-bugs@lists.koha-community.org Reporter: fridolin.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org Bug 27943 added MARC21 authorities 7XX on display. It calls $field->as_string($subfields_to_report). This fails when field is not in known ones. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |34482 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34482 [Bug 34482] Improve MARC21 7xx linking fields in bibliographic records [Omnibus] -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |27943 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27943 [Bug 27943] MARC21 authorities not support 7XX on display -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |fridolin.somers@biblibre.co |ity.org |m Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 --- Comment #1 from Fridolin Somers <fridolin.somers@biblibre.com> --- This creates an ugly warning in logs : Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE ]$/ at /usr/share/perl5/MARC/Field.pm line 643. Because of a call field->as_string with an empty string. Looks like MARC::Field only checks var is undef before using in regexp. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 --- Comment #2 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 186964 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186964&action=edit Bug 40883: Add unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 --- Comment #3 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 186965 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186965&action=edit Bug 40883: Fix authorities display fails on unknown 7XX Bug 27943 added MARC21 authorities 7XX on display. It calls $field->as_string($subfields_to_report). This fails when authority type is custom (not in C4/Heading/MARC21.pm $auth_heading_fields) and so field is not in known ones. We see in other parts that $subfields_to_report may be emty. This patch simply creates 7xx heading with $field->as_string() in this case. Test plan: 1) Run test : prove t/db_dependent/AuthoritiesMarc.t 2) Create a new autority type with main heading in 199 and field 799 3) Create a new authority of this type 4) Perform a search to find it => Without patch the page retruns the error Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE ]$/ at /usr/share/perl5/MARC/Field.pm line 643. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 --- Comment #4 from Fridolin Somers <fridolin.somers@biblibre.com> --- NB : We see in C4/AuthoritiesMarc.pm BuildSummary() that var $subfields_to_report can be set by part building 7xx and then is reused in part building 880. This looks very strange. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- 1) QA checks Failed: tests untidy. 2) Code review 3) Testing - Unit tests pass - Tests pass I got an error when trying to edit the MARC structure of the newly added authority type: CGI::Compile::ROOT::kohadevbox_koha_admin_auth_tag_structure_2epl::auth_tag_structure_2epl(): DBI Exception: DBD::mysql::st execute failed: 'koha_kohadev.auth_types.authtypetext' isn't in GROUP BY at /usr/share/perl5/CGI/Emulate/PSGI.pm line 30 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 Had to set: <strict_sql_modes>0</strict_sql_modes> and restart_all Without patch: - Added a new custom authority type XXX - Copied my PERSO_NAME authority structure into it - Added 789 as a new field with subfield a - Edited an existing authority, changed framework and added the field - Searched: it shows in the authority result list including my 789 info - Checked the logs with tail -f /var/logs/koha/kohadev/*.log - no errors Can you check if the error still persists for you or where my test was faulty? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|34482 | CC| |martin.renvoize@openfifth.c | |o.uk Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34482 [Bug 34482] Improve MARC21 7xx linking fields in bibliographic records [Omnibus] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=44120 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186964|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 --- Comment #6 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211677 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211677&action=edit Bug 40883: Add unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 --- Comment #7 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211678 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211678&action=edit Bug 40883: (QA follow-up) Tidy the tests and do not fail on the 880 of an unknown type Tidy the unit test. The 880 fields of the summary call as_string with the subfields of the last heading that was built. For an authority type that is not in C4::Heading::MARC21, there are none and the same error is raised as for the 7XX: "Unmatched [ in regex" in MARC::Field. Use the subfields a to z, without the linkage in the $6, when there are none. To test: 1. prove t/db_dependent/AuthoritiesMarc.t 2. Create an authority type with the main heading in 199, and an authority of that type with an 880 field, for example $6 199-01 and $a Alternate form 3. Search for it: without this patch the page returns the error "Unmatched [ in regex", with it the 880 is in the summary -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40883 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #8 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Hi Fridolin, Katrin, I have rebased the unit test patch (its plan was in conflict with master, it is 17 now, and the new tests make it 19) and attached a QA follow-up. The fix patch is unchanged. - Katrin's QA failure: the test file is tidy now. - The 880 fields of the summary have the same problem as the 7XX: they use $subfields_to_report, which is empty for an authority type that is not in C4::Heading::MARC21 (for example a heading in 199), and fail with the same "Unmatched [ in regex". The follow-up uses the subfields a to z, without the $6 linkage, in that case, with a test. To test: an authority type with the main heading in 199 and an authority of that type with an 880 field ($6 199-01, $a Alternate form): without the patch the summary fails with the error, with it the 880 is displayed. - Katrin's error when editing the MARC structure of the new authority type ("authtypetext isn't in GROUP BY"): I could reproduce it, and it also happens without this patch, so it is not related. It comes from the query on line 190 of admin/auth_tag_structure.pl, which selects authtypetext but only groups by authtypecode, and fails when the SQL mode includes ONLY_FULL_GROUP_BY. I filed bug 44120 for it, with a patch. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org