[Bug 44070] New: selenium regressions.t expects the old biberror message for a now-repairable record
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Bug ID: 44070 Summary: selenium regressions.t expects the old biberror message for a now-repairable record Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Follow-up to bug 43777, reported by Jonathan Druart on that bug. t/db_dependent/selenium/regressions.t, subtest 'Bibliographic record detail page must not explode even with invalid metadata', stores MARCXML containing non-XML characters in the control fields and expects detail.pl to show <p class="biberror"> ("There is at least one encoding error with this bibliographic record..."). Since bug 43777, Koha::Biblio::Metadata->record() repairs such faults on read, so detail.pl no longer sets decoding_error for this data. The page instead shows the metadata repair warning (metadata_repairs.inc, bug 43026) and the biberror element is not rendered: Unable to locate element: //p[@class="biberror"] at .../Selenium/Remote/Driver.pm line 411 Proposed fix: update the existing subtest to assert on the repair warning for the recoverable record, and add a second case using metadata that cannot be repaired (e.g. truncated XML) to keep coverage of the biberror path. Test plan: 1. Apply the patch. 2. prove t/db_dependent/selenium/regressions.t (inside KTD, with the selenium environment available) 3. Confirm the subtest passes. Sponsored-by: OpenFifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43025 Assignee|chris@bigballofwax.co.nz |martin.renvoize@openfifth.c | |o.uk Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43025 [Bug 43025] Show metadata repair warnings in the cataloguing edit form -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211484 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211484&action=edit Bug 44070: Fix detail page for unreadable metadata and update selenium test Since bug 43777, Koha::Biblio::Metadata->record() repairs recoverable faults on read, so the selenium subtest that stored non-XML characters in the control fields no longer reaches the biberror path: the page shows the metadata repair warning instead. Update that subtest to assert on the repair warning, and add a second subtest using truncated MARCXML (which cannot be repaired) to keep covering the "encoding error" notice. That second subtest exposed a real problem: for metadata that cannot be parsed at all, catalogue/detail.pl left $marc_record undefined and died with "Can't call method "leader" on an undefined value" instead of showing the encoding error. Fall back to an empty MARC::Record so the rest of the page still renders alongside the error. To test: 1. Apply the patch and restart_all 2. prove t/db_dependent/selenium/regressions.t => SUCCESS: Tests pass 3. In the staff interface, truncate a record's MARCXML in biblio_metadata (remove the closing </record>) and open its detail page => The "Encoding errors" notice is shown, not an error trace Sponsored-by: OpenFifth Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|selenium regressions.t |Detail page dies on |expects the old biberror |unparseable metadata; |message for a |selenium regressions.t |now-repairable record |expects the old biberror | |for a now-repairable record -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211484|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=44070 --- Comment #2 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 211537 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211537&action=edit Bug 44070: Fix detail page for unreadable metadata and update selenium test Since bug 43777, Koha::Biblio::Metadata->record() repairs recoverable faults on read, so the selenium subtest that stored non-XML characters in the control fields no longer reaches the biberror path: the page shows the metadata repair warning instead. Update that subtest to assert on the repair warning, and add a second subtest using truncated MARCXML (which cannot be repaired) to keep covering the "encoding error" notice. That second subtest exposed a real problem: for metadata that cannot be parsed at all, catalogue/detail.pl left $marc_record undefined and died with "Can't call method "leader" on an undefined value" instead of showing the encoding error. Fall back to an empty MARC::Record so the rest of the page still renders alongside the error. To test: 1. Apply the patch and restart_all 2. prove t/db_dependent/selenium/regressions.t => SUCCESS: Tests pass 3. In the staff interface, truncate a record's MARCXML in biblio_metadata (remove the closing </record>) and open its detail page => The "Encoding errors" notice is shown, not an error trace Sponsored-by: OpenFifth Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adolfo.rodriguez@xercode.es --- Comment #3 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Tested in a sandbox instance with a record whose MARCXML was truncated in biblio_metadata (closing </record> removed): - Before the patch, catalogue/detail.pl died with "Can't call method "leader" on an undefined value at catalogue/detail.pl line 202". - After the patch, the detail page loads and shows the "Encoding errors" notice with the parser error, and the rest of the page renders. The QA script is happy. I could not run t/db_dependent/selenium/regressions.t: in my KTD no selenium test gets past the login form, on main as well, so it is my environment and not this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=44122 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org