https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44069
Bug ID: 44069
Summary: svc/bib still calls removed record_strip_nonxml and no
longer reports repaired records
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Cataloging
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
Target Milestone: ---
Follow-up to bug 43777, reported by Adolfo Rodriguez on that bug.
Bug 43777 made Koha::Biblio::Metadata->record() repair recoverable MARCXML
faults on read and removed Koha::Biblio::Metadata->record_strip_nonxml. svc/bib
(fetch_bib) was not adapted:
- When metadata_record() throws Koha::Exceptions::Metadata::Invalid, fetch_bib
still calls $biblio->metadata->record_strip_nonxml, which no longer exists.
Unrecoverable records now die with a missing-method error instead of returning
a proper error.
- Recoverable records never reach that branch any more, because
metadata_record() already returns the repaired record. The invalid_metadata
header is therefore never sent, and the advanced cataloguing editor
(koha-backend.js, GetRecord) no longer shows "Record had encoding issues,
please switch to the basic editor to view details".
Proposed fix: drop the record_strip_nonxml call and return a proper error
response for unrecoverable records; set the invalid_metadata header when
$biblio->metadata->object_messages is not empty, as
Koha::OAI::Server::Repository->get_biblio_marcxml does.
Test plan:
1. Apply the patch.
2. Create a record whose stored MARCXML contains a control character (e.g.
0x1F) in a subfield, directly in biblio_metadata.
3. Request /cgi-bin/koha/svc/bib/<biblionumber> and confirm the response
carries the invalid_metadata header and the repaired record.
4. Open the record in the advanced cataloguing editor and confirm the encoding
warning is shown.
5. Break the record so it cannot be repaired (truncated XML) and confirm
svc/bib returns an error rather than a missing-method exception.
6. prove t/db_dependent/svc/bib.t (or the new test added by the patch)
Sponsored-by: OpenFifth
--
You are receiving this mail because:
You are the assignee for the bug.
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/