[Bug 21708] New: Editing a record moves field 999 to first in the marcxml
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Bug ID: 21708 Summary: Editing a record moves field 999 to first in the marcxml Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: pasi.kallinen@joensuu.fi QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl 1) Import or create a new record. 2) Examine the marcxml of that record in the database - the fields are in the correct numerical order. 3) Edit the record - no need to change any data, just save it. 4) Examine the marcxml in the database - the 999 field is now right after leader and before 001. This is due to TransformHtmlToMarc in C4/Biblio.pm, specifically the $param eq 'biblionumber' case, which pushes the param in the array first, and then the sub uses $record->append_field() Perhaps the array should be sorted by field tag before appending the fields? AFAIK, this doesn't really show up anywhere in Koha, but if you ever edit the records via a script using MARC::Record, new fields cannot be easily inserted into correct position. -- 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=21708 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- I've noticed this as well recently. I was wondering if it was intentional or not... -- 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=21708 paxed <pasi.kallinen@joensuu.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21881 -- 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=21708 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Is this really a regression? If it is, could you tell me a version which was behaving as expected? -- 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=21708 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |DUPLICATE Status|NEW |RESOLVED See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21881 | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** This bug has been marked as a duplicate of bug 21881 *** -- 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=21708 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #3)
*** This bug has been marked as a duplicate of bug 21881 ***
I think maybe 21881 should've been marked as a duplicate of this bug? Should we move the discussion over to 21881? -- 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=21708 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #2)
Is this really a regression? If it is, could you tell me a version which was behaving as expected?
I'd say it's a regression. As for a version which was behaving as expected... I'd have to double-check, but I think it was OK in Koha 3.20 but not Koha 17.05. -- 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=21708 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|DUPLICATE |--- -- 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=21708 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEW -- 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=21708 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |iming@rosewoodfarm.com.au --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 21881 has been marked as a duplicate of this bug. *** -- 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=21708 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to David Cook from comment #4)
(In reply to Jonathan Druart from comment #3)
*** This bug has been marked as a duplicate of bug 21881 ***
I think maybe 21881 should've been marked as a duplicate of this bug? Should we move the discussion over to 21881?
Sorry, I meant to do the reverse. -- 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=21708 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 83365 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83365&action=edit 999 should not be in the first field -- 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=21708 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to David Cook from comment #5)
(In reply to Jonathan Druart from comment #2)
Is this really a regression? If it is, could you tell me a version which was behaving as expected?
I'd say it's a regression. As for a version which was behaving as expected... I'd have to double-check, but I think it was OK in Koha 3.20 but not Koha 17.05.
I have written a quick test to confirm that: it seems that 3.20 behaved as it already. -- 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=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.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=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #83365|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=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 100469 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100469&action=edit Bug 21708: Sort MARC fields in TransformHtmlToMarc Instead of pushing 999 in the front :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Still adding small test and benchmarking -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Record with 25 fields: 0.000038 sec -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to paxed from comment #0)
This is due to TransformHtmlToMarc in C4/Biblio.pm, specifically the $param eq 'biblionumber' case, which pushes the param in the array first, and then the sub uses $record->append_field()
Perhaps the array should be sorted by field tag before appending the fields?
Yes, I saw that too :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100469|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 100556 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100556&action=edit Bug 24544: Add script to insert persistent identifiers -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100556|0 |1 is obsolete| | --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Comment on attachment 100556 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100556 Bug 24544: Add script to insert persistent identifiers Wrong report -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 100557 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100557&action=edit Bug 21708: Add a few tests in TransformHtmlToMarc.t Test plan: Run t/db_dependent/Biblio/TransformHtmlToMarc.t without the module change patch. Verify that the test fails on the order of fields. Go to test plan of the second patch. Signed-off-by: Marcel de Rooy <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=21708 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 100558 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100558&action=edit Bug 21708: Sort MARC fields in TransformHtmlToMarc Instead of pushing 999 in the front :) Test plan: Do not yet apply this patch. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field (MARC21 999) follows leader. Apply this patch. Restart Plack. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field is in right position. Run t/db_dependent/Biblio/TransformHtmlToMarc.t. Should pass now. Signed-off-by: Marcel de Rooy <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=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|minor |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=24544 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100557|0 |1 is obsolete| | --- Comment #18 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 101334 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101334&action=edit Bug 21708: Add a few tests in TransformHtmlToMarc.t Test plan: Run t/db_dependent/Biblio/TransformHtmlToMarc.t without the module change patch. Verify that the test fails on the order of fields. Go to test plan of the second patch. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test fails -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100558|0 |1 is obsolete| | --- Comment #19 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 101335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101335&action=edit Bug 21708: Sort MARC fields in TransformHtmlToMarc Instead of pushing 999 in the front :) Test plan: Do not yet apply this patch. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field (MARC21 999) follows leader. Apply this patch. Restart Plack. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field is in right position. Run t/db_dependent/Biblio/TransformHtmlToMarc.t. Should pass now. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass, correct tag order. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |bgkriegel@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=21708 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #101334|0 |1 is obsolete| | --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 101377 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101377&action=edit Bug 21708: Add a few tests in TransformHtmlToMarc.t Test plan: Run t/db_dependent/Biblio/TransformHtmlToMarc.t without the module change patch. Verify that the test fails on the order of fields. Go to test plan of the second patch. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test fails Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #101335|0 |1 is obsolete| | --- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 101378 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101378&action=edit Bug 21708: Sort MARC fields in TransformHtmlToMarc Instead of pushing 999 in the front :) Test plan: Do not yet apply this patch. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field (MARC21 999) follows leader. Apply this patch. Restart Plack. Edit a record. Save. And open MARC view/view plain on opac-detail. Verify that the biblionumber field is in right position. Run t/db_dependent/Biblio/TransformHtmlToMarc.t. Should pass now. Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Test pass, correct tag order. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thx Bernardo and Katrin -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.05.00 |20.05.00, 19.11.05 released in| | Status|Pushed to master |Pushed to stable CC| |joy@bywatersolutions.com --- Comment #24 from Joy Nelson <joy@bywatersolutions.com> --- backported to 19.11.x for 19.11.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable Version(s)|20.05.00, 19.11.05 |20.05.00, 19.11.05, released in| |19.05.10 --- Comment #25 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 19.05.x for 19.05.10 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21708 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hayleymapley@catalyst.net.n | |z --- Comment #26 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Minor behaviour patch will not be backported to 18.11.x series. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org