[Bug 31644] New: MARCModification template fails to copy to/from subfield 0
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Bug ID: 31644 Summary: MARCModification template fails to copy to/from subfield 0 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Like 26781 or 26894 - but for copy action which appears to have been missed -- 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=31644 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=31644 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 141066 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141066&action=edit Bug 31644: Check if subfield defined, not for truth To test: 1 - Define a new MARC Modification template with actions: Copy field 600$a to 942$0 2 - Define a new record like: LDR 00334nam a22001217a 4500 003 ff 005 20201102111604.0 008 201102b xxu||||| |||| 00| 0 eng d 040 _ _ ‡cvsd 100 1 _ ‡012345‡aKnuth, Donal Ervin‡d1938 245 _ _ ‡012345‡aThe aty of computer programming‡cDonald E. Knuth 600 _ 0 ‡042‡aComputer programming‡9462 3 - Modify this record using the template above 4 - Note that entire field is copied to 942 5 - Apply patch 6 - Now only subfield 0 is copied -- 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=31644 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |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=31644 --- Comment #2 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 141091 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141091&action=edit Bug 31644: Unit test -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141066|0 |1 is obsolete| | --- Comment #3 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 141092 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141092&action=edit Bug 31644: Check if subfield defined, not for truth To test: 1 - Define a new MARC Modification template with actions: Copy field 600$a to 942$0 2 - Define a new record like: LDR 00334nam a22001217a 4500 003 ff 005 20201102111604.0 008 201102b xxu||||| |||| 00| 0 eng d 040 _ _ ‡cvsd 100 1 _ ‡012345‡aKnuth, Donal Ervin‡d1938 245 _ _ ‡012345‡aThe aty of computer programming‡cDonald E. Knuth 600 _ 0 ‡042‡aComputer programming‡9462 3 - Modify this record using the template above 4 - Note that entire field is copied to 942 5 - Apply patch 6 - Now only subfield 0 is copied -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 141093 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141093&action=edit Bug 31644: Add copy test and clarify some functions This patch adds a tst for copy without subfields. I also clarify what eachstep does so the next user/coder understands current behaviour Update existing or add new: In the case where the field/subfield exists we update, if we have two fields - one with the subfield, and one without, we add the subfield to the one without Copy field: - If given a subfield - we will add to existing fields in the record - If not given a subfield - we create an entirely new field The logic of all of this is tricky, makes sense in a certain light, any complaints are for a new bug :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- I attempted to test. The record is updated, however there is this message in the job list after running the batch modification: Bibliographic record 439 has not been modified. An error occurred on modifying it. (C4::Biblio::_koha_modify_biblioitem_nonmarc(): DBI Exception: DBD::mysql::st execute failed: Incorrect integer value: 'Computer programming' for column `koha_kohadev`.`biblioitems`.`totalissues` at row 1 at /kohadevbox/koha/C4/Biblio.pm line 425 ). Here is the record after the batch record modification is run. 000 nam a22 7a 4500 003 ff 005 20221015202837.0 008 201102b xxu||||| |||| 00| 0 eng d 040 _ _ ‡cvsd 100 1 _ ‡012345‡9102‡aKnuth, Donald Ervin,‡d1938- 245 _ _ ‡012345‡aThe aty of computer programming‡cDonald E. Knuth 600 _ 0 ‡042‡aComputer programming‡9462 999 _ _ ‡c439‡d439 942 _ _ ‡0Computer programming -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to David Nind from comment #5)
I attempted to test.
The record is updated, however there is this message in the job list after running the batch modification:
Bibliographic record 439 has not been modified. An error occurred on modifying it. (C4::Biblio::_koha_modify_biblioitem_nonmarc(): DBI Exception: DBD::mysql::st execute failed: Incorrect integer value: 'Computer programming' for column `koha_kohadev`.`biblioitems`.`totalissues` at row 1 at /kohadevbox/koha/C4/Biblio.pm line 425 ).
That's my fault, the test plan has you copy text to a numeric field. If you try with a field that has a number is suspect you won't get that error -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 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=31644 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141091|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 141936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141936&action=edit Bug 31644: Unit test 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=31644 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141092|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 141937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141937&action=edit Bug 31644: Check if subfield defined, not for truth To test: 1 - Define a new MARC Modification template with actions: Copy field 600$a to 942$0 2 - Define a new record like: LDR 00334nam a22001217a 4500 003 ff 005 20201102111604.0 008 201102b xxu||||| |||| 00| 0 eng d 040 _ _ ‡cvsd 100 1 _ ‡012345‡aKnuth, Donal Ervin‡d1938 245 _ _ ‡012345‡aThe aty of computer programming‡cDonald E. Knuth 600 _ 0 ‡042‡aComputer programming‡9462 3 - Modify this record using the template above 4 - Note that entire field is copied to 942 5 - Apply patch 6 - Now only subfield 0 is copied 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=31644 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141093|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 141938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141938&action=edit Bug 31644: Add copy test and clarify some functions This patch adds a tst for copy without subfields. I also clarify what eachstep does so the next user/coder understands current behaviour Update existing or add new: In the case where the field/subfield exists we update, if we have two fields - one with the subfield, and one without, we add the subfield to the one without Copy field: - If given a subfield - we will add to existing fields in the record - If not given a subfield - we create an entirely new field The logic of all of this is tricky, makes sense in a certain light, any complaints are for a new bug :-) 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=31644 --- Comment #10 from David Nind <david@davidnind.com> --- (In reply to Nick Clemens from comment #6)
That's my fault, the test plan has you copy text to a numeric field. If you try with a field that has a number is suspect you won't get that error
I ended up using this MARC modification template for step 1: Copy field 600$0 to 611$0 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> ---
The logic of all of this is tricky, makes sense in a certain light, any complaints are for a new bug :-)
LOL The module change makes sense to me, reading the tests is hard, you need to make a study of the logic in order to grasp whats going on there.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA 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=31644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141936|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 142298 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142298&action=edit Bug 31644: Unit test Signed-off-by: David Nind <david@davidnind.com> 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=31644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141937|0 |1 is obsolete| | --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 142299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142299&action=edit Bug 31644: Check if subfield defined, not for truth To test: 1 - Define a new MARC Modification template with actions: Copy field 600$a to 942$0 2 - Define a new record like: LDR 00334nam a22001217a 4500 003 ff 005 20201102111604.0 008 201102b xxu||||| |||| 00| 0 eng d 040 _ _ ‡cvsd 100 1 _ ‡012345‡aKnuth, Donal Ervin‡d1938 245 _ _ ‡012345‡aThe aty of computer programming‡cDonald E. Knuth 600 _ 0 ‡042‡aComputer programming‡9462 3 - Modify this record using the template above 4 - Note that entire field is copied to 942 5 - Apply patch 6 - Now only subfield 0 is copied Signed-off-by: David Nind <david@davidnind.com> 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=31644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #141938|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 142300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142300&action=edit Bug 31644: Add copy test and clarify some functions This patch adds a tst for copy without subfields. I also clarify what eachstep does so the next user/coder understands current behaviour Update existing or add new: In the case where the field/subfield exists we update, if we have two fields - one with the subfield, and one without, we add the subfield to the one without Copy field: - If given a subfield - we will add to existing fields in the record - If not given a subfield - we create an entirely new field The logic of all of this is tricky, makes sense in a certain light, any complaints are for a new bug :-) Signed-off-by: David Nind <david@davidnind.com> 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=31644 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 142301 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=142301&action=edit Bug 31644: (QA follow-up) Add two missing shebang lines 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=31644 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.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=31644 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.08, released in| |21.11.15 Status|Pushed to master |Pushed to stable CC| |arthur.suzuki@biblibre.com --- Comment #17 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- Lucas did not update that one but it's applied to 22.05 for (I guess) 22.05.08. I applied to 21.11 for 21.11.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 Lauren Denny <lauren_denny@sil.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lauren_denny@sil.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31644 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #18 from wainuiwitikapark@catalyst.net.nz --- Not backported to 21.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org