[Bug 43642] New: Show metadata repair warnings in the advanced cataloguing editor
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 Bug ID: 43642 Summary: Show metadata repair warnings in the advanced cataloguing editor Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Target Milestone: --- To recreate: Add some metadata errors: INSERT INTO biblio_metadata_errors (metadata_id,error_type,tag,subfield,message) VALUES (368,'nonxml_chars',520,"a","Ugly chars"),(368,'empty_datafields',515,"b","Empty headed"); Edit the related record in standard cataloging editor - see the warnings Switch to the advanced cataloging editor: no feedback -- 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=43642 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |43025 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211490 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211490&action=edit Bug 43642: Show metadata repair warnings in the advanced cataloguing editor The advanced (MARC21) cataloguing editor only showed a generic "Record had encoding issues" alert when svc/bib reported a repaired record, and never listed the faults themselves. Cataloguers had no way to see what had been changed or to resolve the recorded faults, unlike the basic editor. This patch shows the same "Data quality warnings" banner as the basic editor when a record is opened in the advanced editor: - A new GET /api/v1/biblios/{biblio_id}/metadata/errors lists the unresolved metadata errors recorded for the biblio. The repairs made on read are stored as error rows, so this covers both faults repaired just now and faults recorded earlier. - The banner lists each fault with its field, problem and location, and a "Mark resolved" button that calls the existing DELETE /api/v1/biblios/{biblio_id}/metadata/errors/{error_id}. The banner hides once the last fault is resolved. - The generic alert is kept only as a fallback when svc/bib reported repairs but no error rows could be listed, and for the duplicate backend, which does not show the banner. The banner does not link to the affected field, unlike the basic editor. To test: 1. Apply the patch and restart services (yarn build && restart_all, as the swagger file changed). 2. Create a biblio and insert a metadata error for it: INSERT INTO biblio_metadata_errors (metadata_id, error_type, tag, subfield, message) SELECT id, 'nonxml_stripped', '245', 'a', '245$a: invalid char value 31 (U+001F) at position 5' FROM biblio_metadata WHERE biblionumber = <biblionumber>; 3. Open the record in the advanced editor (cataloguing/editor.pl#catalog/<biblionumber>). Confirm the "Data quality warnings" banner lists the error. 4. Click "Mark resolved". Confirm the row goes, and the banner hides when the last one is gone. Check the row is removed from biblio_metadata_errors. 5. Store a record with a control character (chr(31)) in a subfield directly in biblio_metadata.metadata, then open it in the advanced editor. Confirm the banner lists the repaired fault. 6. GET /api/v1/biblios/<biblionumber>/metadata/errors returns the list, and a non-existent biblio returns 404. 7. Run: prove t/db_dependent/api/v1/biblios_metadata_errors.t 8. Run: npx cypress run --spec t/cypress/integration/AdvancedEditorMetadataErrors_spec.ts 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. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|43025 |44069 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43025 [Bug 43025] Show metadata repair warnings in the cataloguing edit form https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44069 [Bug 44069] svc/bib still calls removed record_strip_nonxml and no longer reports repaired records -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Comma delimited| |OpenFifth list of Sponsors| | 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=43642 Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211490|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=43642 --- Comment #2 from Adolfo Rodríguez Taboada <adolfo.rodriguez@xercode.es> --- Created attachment 211541 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211541&action=edit Bug 43642: Show metadata repair warnings in the advanced cataloguing editor The advanced (MARC21) cataloguing editor only showed a generic "Record had encoding issues" alert when svc/bib reported a repaired record, and never listed the faults themselves. Cataloguers had no way to see what had been changed or to resolve the recorded faults, unlike the basic editor. This patch shows the same "Data quality warnings" banner as the basic editor when a record is opened in the advanced editor: - A new GET /api/v1/biblios/{biblio_id}/metadata/errors lists the unresolved metadata errors recorded for the biblio. The repairs made on read are stored as error rows, so this covers both faults repaired just now and faults recorded earlier. - The banner lists each fault with its field, problem and location, and a "Mark resolved" button that calls the existing DELETE /api/v1/biblios/{biblio_id}/metadata/errors/{error_id}. The banner hides once the last fault is resolved. - The generic alert is kept only as a fallback when svc/bib reported repairs but no error rows could be listed, and for the duplicate backend, which does not show the banner. The banner does not link to the affected field, unlike the basic editor. To test: 1. Apply the patch and restart services (yarn build && restart_all, as the swagger file changed). 2. Create a biblio and insert a metadata error for it: INSERT INTO biblio_metadata_errors (metadata_id, error_type, tag, subfield, message) SELECT id, 'nonxml_stripped', '245', 'a', '245$a: invalid char value 31 (U+001F) at position 5' FROM biblio_metadata WHERE biblionumber = <biblionumber>; 3. Open the record in the advanced editor (cataloguing/editor.pl#catalog/<biblionumber>). Confirm the "Data quality warnings" banner lists the error. 4. Click "Mark resolved". Confirm the row goes, and the banner hides when the last one is gone. Check the row is removed from biblio_metadata_errors. 5. Store a record with a control character (chr(31)) in a subfield directly in biblio_metadata.metadata, then open it in the advanced editor. Confirm the banner lists the repaired fault. 6. GET /api/v1/biblios/<biblionumber>/metadata/errors returns the list, and a non-existent biblio returns 404. 7. Run: prove t/db_dependent/api/v1/biblios_metadata_errors.t 8. Run: npx cypress run --spec t/cypress/integration/AdvancedEditorMetadataErrors_spec.ts 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=43642 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 on top of bug 44069 with a record that had a control character (chr(31)) in 245$a: - Before the patch, the advanced editor only showed the generic "Record had encoding issues, please switch to the basic editor to view details" alert, and GET /api/v1/biblios/<id>/metadata/errors returned 404. - After the patch, the "Data quality warnings" banner lists the repaired fault (field, problem and location). "Mark resolved" removes the row from the banner and from biblio_metadata_errors, and the banner hides once the last one is gone and stays hidden on reload. The endpoint returns the list, an empty list after resolving, and 404 for a non-existent biblio. The QA script is happy, and t/db_dependent/api/v1/biblios_metadata_errors.t and t/db_dependent/svc/bib.t pass. I did not run the Cypress test. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |arthur.suzuki@biblibre.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43642 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211541|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=43642 --- Comment #4 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Created attachment 212367 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212367&action=edit Bug 43642: Show metadata repair warnings in the advanced cataloguing editor The advanced (MARC21) cataloguing editor only showed a generic "Record had encoding issues" alert when svc/bib reported a repaired record, and never listed the faults themselves. Cataloguers had no way to see what had been changed or to resolve the recorded faults, unlike the basic editor. This patch shows the same "Data quality warnings" banner as the basic editor when a record is opened in the advanced editor: - A new GET /api/v1/biblios/{biblio_id}/metadata/errors lists the unresolved metadata errors recorded for the biblio. The repairs made on read are stored as error rows, so this covers both faults repaired just now and faults recorded earlier. - The banner lists each fault with its field, problem and location, and a "Mark resolved" button that calls the existing DELETE /api/v1/biblios/{biblio_id}/metadata/errors/{error_id}. The banner hides once the last fault is resolved. - The generic alert is kept only as a fallback when svc/bib reported repairs but no error rows could be listed, and for the duplicate backend, which does not show the banner. The banner does not link to the affected field, unlike the basic editor. To test: 1. Apply the patch and restart services (yarn build && restart_all, as the swagger file changed). 2. Create a biblio and insert a metadata error for it: INSERT INTO biblio_metadata_errors (metadata_id, error_type, tag, subfield, message) SELECT id, 'nonxml_stripped', '245', 'a', '245$a: invalid char value 31 (U+001F) at position 5' FROM biblio_metadata WHERE biblionumber = <biblionumber>; 3. Open the record in the advanced editor (cataloguing/editor.pl#catalog/<biblionumber>). Confirm the "Data quality warnings" banner lists the error. 4. Click "Mark resolved". Confirm the row goes, and the banner hides when the last one is gone. Check the row is removed from biblio_metadata_errors. 5. Store a record with a control character (chr(31)) in a subfield directly in biblio_metadata.metadata, then open it in the advanced editor. Confirm the banner lists the repaired fault. 6. GET /api/v1/biblios/<biblionumber>/metadata/errors returns the list, and a non-existent biblio returns 404. 7. Run: prove t/db_dependent/api/v1/biblios_metadata_errors.t 8. Run: npx cypress run --spec t/cypress/integration/AdvancedEditorMetadataErrors_spec.ts Sponsored-by: OpenFifth Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Adolfo Rodríguez <adolfo.rodriguez@xercode.es> Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org