[Bug 41843] New: Koha::Authorities->move
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 Bug ID: 41843 Summary: Koha::Authorities->move Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: MARC Authority data support Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org -- 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=41843 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Koha::Authorities->move |Koha::Authorities->move_to_ | |deleted can die on encoding | |errors --- Comment #1 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- We should add a try/catch around: $data->{marcxml} = $record->as_xml_record($format); and try to ignore bad characters as we do for biblios in other parts of the code - we've already decided to delete it, bad characters shouldn't stop us -- 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=41843 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | 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=41843 --- Comment #2 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 196625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196625&action=edit Bug 41843: GRacefully handle xml errors during authority deletion This patch updates move_to_deleted in Koha::Authorities to attempt to handle encoding errors and delete a record with invalid marcxml. If recoverable, the leader of the deletd record will be updated to reflect deletion , but in the case it cannot the XML will be saved unaltered. To test: 1 - Find an authority record that is not used in your Koha More->Authorities, search for 'a' Record #1541 for example 2 - Make the record have errors: sudo koha-mysql kohadev UPDATE auth_header SET marcxml = UpdateXML(marcxml, '//datafield[@tag="040"]/subfield[@code="c"]',CONCAT('<subfield code',CHAR(27),'="c">OSt</subfield>')) WHERE auth_header.authid=1541; 3 - In the search results, click Actions->Delete 4 - Error 500! 5 - Apply patch, restart all 6 - Delete the record 7 - Success! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com, | |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=42156 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 David Nind <david@davidnind.com> 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=41843 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 197014 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197014&action=edit Bug 41843: Gracefully handle XML errors during authority deletion This patch updates move_to_deleted in Koha::Authorities to attempt to handle encoding errors and delete a record with invalid marcxml. If recoverable, the leader of the deletd record will be updated to reflect deletion, but in the case it cannot the XML will be saved unaltered. To test: 1 - Find an authority record that is not used in your Koha More->Authorities, search for 'a' Record #1541 for example 2 - Make the record have errors: sudo koha-mysql kohadev UPDATE auth_header SET marcxml = UpdateXML(marcxml, '//datafield[@tag="040"]/subfield[@code="c"]',CONCAT('<subfield code',CHAR(27),'="c">OSt</subfield>')) WHERE auth_header.authid=1541; 3 - In the search results, click Actions->Delete 4 - Error 500! 5 - Apply patch, restart all 6 - Delete the record 7 - Success! Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Attachment #196625|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=41843 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes deleting release notes| |authority records - you can | |now successfully delete | |authority records with | |encoding errors and invalid | |MARCXML. | | | |Previously, attempting to | |delete an authority record | |with encoding errors would | |result in a 500 error. --- Comment #4 from David Nind <david@davidnind.com> --- I edited the commit message slightly (title and line formatting). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.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=41843 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197014|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=41843 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 197057 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197057&action=edit Bug 41843: Gracefully handle XML errors during authority deletion This patch updates move_to_deleted in Koha::Authorities to attempt to handle encoding errors and delete a record with invalid marcxml. If recoverable, the leader of the deletd record will be updated to reflect deletion, but in the case it cannot the XML will be saved unaltered. To test: 1 - Find an authority record that is not used in your Koha More->Authorities, search for 'a' Record #1541 for example 2 - Make the record have errors: sudo koha-mysql kohadev UPDATE auth_header SET marcxml = UpdateXML(marcxml, '//datafield[@tag="040"]/subfield[@code="c"]',CONCAT('<subfield code',CHAR(27),'="c">OSt</subfield>')) WHERE auth_header.authid=1541; 3 - In the search results, click Actions->Delete 4 - Error 500! 5 - Apply patch, restart all 6 - Delete the record 7 - Success! Signed-off-by: David Nind <david@davidnind.com> Amended-by: Jonathan Druart tidy Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 --- Comment #6 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42156 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42156 [Bug 42156] Staging and matching authorities with bad characters can fail -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 --- Comment #7 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org