https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44070

--- Comment #2 from Adolfo Rodríguez Taboada <[email protected]> ---
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 <[email protected]>
Signed-off-by: Adolfo Rodríguez <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to