[Bug 28832] New: Batch modification always clears permanent_location if it is mapped in frameworks
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Bug ID: 28832 Summary: Batch modification always clears permanent_location if it is mapped in frameworks Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org On bug 27837 we ensured that the value for permanent_location was always passed through to the edit Unfortunately - when performing a batch mod the field is not set if we don't want to change it or clear it Forcing the pass through then means we clear the field on every update To recreate: 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor 2 - In mappings map that subfield to items.permanent_location 3 - Set an item to have differing shelving location and permanent_location 4 - This saves correctly for an individual item 5 - Edit the item using Tools->batch item modification, updating the note field 6 - Note the permanet_location is removed 7 - Check the DB, the field is set to NULL -- 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=28832 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Depends on| |27837 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27837 [Bug 27837] Permanent location is reverted to location when location updated and permanent_location mapped to MARC field -- 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=28832 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 123654 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123654&action=edit Bug 28832: Don't batch modify fields that we don't update In bug 27837 we made sure to always pass through the permanent_location if it was passed in unlike other fields which are not passed if they have no value. During batch mod, however, fields that aren't editied have no value, so forcing permanent_location to pass through forces blanking it. This patch alters the script to only pass thgouhr for edit the fields that have been updated or cleared. To test: 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor 2 - In mappings map that subfield to items.permanent_location 3 - Set an item to have differing shelving location and permanent_location 4 - This saves correctly for an individual item 5 - Edit the item using Tools->batch item modification, updating the note field 6 - Note the permanet_location is removed 7 - Check the DB, the field is set to NULL 8 - Apply patch 9 - Repeat 10 - Permanent location is not cleared 11 - Verify that clearing fields works as before, including permanent_location -- 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=28832 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27526 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=28832 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com, | |martin.renvoize@ptfs-europe | |.com, | |nick@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.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=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123654|0 |1 is obsolete| | --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 123966 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123966&action=edit Bug 28832: Don't batch modify fields that we don't update In bug 27837 we made sure to always pass through the permanent_location if it was passed in unlike other fields which are not passed if they have no value. During batch mod, however, fields that aren't editied have no value, so forcing permanent_location to pass through forces blanking it. This patch alters the script to only pass thgouhr for edit the fields that have been updated or cleared. To test: 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor 2 - In mappings map that subfield to items.permanent_location 3 - Set an item to have differing shelving location and permanent_location 4 - This saves correctly for an individual item 5 - Edit the item using Tools->batch item modification, updating the note field 6 - Note the permanet_location is removed 7 - Check the DB, the field is set to NULL 8 - Apply patch 9 - Repeat 10 - Permanent location is not cleared 11 - Verify that clearing fields works as before, including permanent_location Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com | |, | |dstephen@dubuque.lib.ia.us -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123966|0 |1 is obsolete| | --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 123982 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123982&action=edit Bug 28832: Don't batch modify fields that we don't update In bug 27837 we made sure to always pass through the permanent_location if it was passed in unlike other fields which are not passed if they have no value. During batch mod, however, fields that aren't editied have no value, so forcing permanent_location to pass through forces blanking it. This patch alters the script to only pass thgouhr for edit the fields that have been updated or cleared. To test: 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor 2 - In mappings map that subfield to items.permanent_location 3 - Set an item to have differing shelving location and permanent_location 4 - This saves correctly for an individual item 5 - Edit the item using Tools->batch item modification, updating the note field 6 - Note the permanet_location is removed 7 - Check the DB, the field is set to NULL 8 - Apply patch 9 - Repeat 10 - Permanent location is not cleared 11 - Verify that clearing fields works as before, including permanent_location Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Deb Stephenson <dstephen@dubuque.lib.ia.us> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joonas.kylmala@iki.fi Status|Signed Off |Failed QA --- Comment #4 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- All the repeated fields need to be spliced off for this to work. Now for example this breaks the regex replace functionality. If I try to change the copynumber with: t - Copy number s/.*/ TTT / using the batchmod tool it doesn't work after this patch. I think the indicator field modification might be broken now as well (didn't check but looking at the batchMod.pl code it seems so) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 --- Comment #5 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 125075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125075&action=edit Bug 28832: (follow-up) Handle regex fields too -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.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=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123982|0 |1 is obsolete| | --- Comment #6 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125076 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125076&action=edit Bug 28832: Don't batch modify fields that we don't update In bug 27837 we made sure to always pass through the permanent_location if it was passed in unlike other fields which are not passed if they have no value. During batch mod, however, fields that aren't editied have no value, so forcing permanent_location to pass through forces blanking it. This patch alters the script to only pass thgouhr for edit the fields that have been updated or cleared. To test: 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor 2 - In mappings map that subfield to items.permanent_location 3 - Set an item to have differing shelving location and permanent_location 4 - This saves correctly for an individual item 5 - Edit the item using Tools->batch item modification, updating the note field 6 - Note the permanet_location is removed 7 - Check the DB, the field is set to NULL 8 - Apply patch 9 - Repeat 10 - Permanent location is not cleared 11 - Verify that clearing fields works as before, including permanent_location Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Deb Stephenson <dstephen@dubuque.lib.ia.us> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125075|0 |1 is obsolete| | --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 125077 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125077&action=edit Bug 28832: (follow-up) Handle regex fields too Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 --- Comment #8 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Repeated the original test plan and then did a second batch edit, successfully editing a field via regex, confirmed that edit worked and did not mess up the shelving locations. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 --- Comment #9 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- The indicator code was not handled here but on a closer look it seems unused, and for some reason the same indicator code is copied all over Koha codebase unused as well. I will open a separate ticket to remove the indicator related code with items. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Joonas Kylmälä <joonas.kylmala@iki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #10 from Joonas Kylmälä <joonas.kylmala@iki.fi> --- After applying the patches modifying the item fields to values that evaluate in perl to false is impossible. The conditions in
unless( $values[$i] || $searches[$i] || grep { $subfields[$i] } @disabled ){
should be the same as just above it, i.e. if the value is empty string or not. To reproduce: 1) Try to change inventory field to 0 and notice it is not modified. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- After bug 28445 I don't recreate the problem. Can you confirm, Nick? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|master |21.05 --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #11)
After bug 28445 I don't recreate the problem. Can you confirm, Nick?
Yes, however, it still affects 21.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 --- Comment #13 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 127982 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=127982&action=edit Bug 28832: (follow-up) Don't remove false values, only empty strings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Joonas Kylmälä from comment #10)
After applying the patches modifying the item fields to values that evaluate in perl to false is impossible. The conditions in
unless( $values[$i] || $searches[$i] || grep { $subfields[$i] } @disabled ){
should be the same as just above it, i.e. if the value is empty string or not.
Updated
To reproduce: 1) Try to change inventory field to 0 and notice it is not modified.
I actually find this is true from the item editor as well - it is not caused by this patchset -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am sorry, this no longer applies - can you please rebase? Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 28832: Don't batch modify fields that we don't update Using index info to reconstruct a base tree... M tools/batchMod.pl Falling back to patching base and 3-way merge... Auto-merging tools/batchMod.pl CONFLICT (content): Merge conflict in tools/batchMod.pl error: Failed to merge in the changes. Patch failed at 0001 Bug 28832: Don't batch modify fields that we don't update The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-28832-Dont-batch-modify-fields-that-we-dont-up-dHzj6t.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #15)
I am sorry, this no longer applies - can you please rebase?
Applies cleanly to 21.05.x for me -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Batch modification always |[21.05] Batch modification |clears permanent_location |always clears |if it is mapped in |permanent_location if it is |frameworks |mapped in frameworks --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I missed that this was for an older version only - I have added to the description to make it more visible. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Rhonda Kuiper <rkuiper@roundrocktexas.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rkuiper@roundrocktexas.gov --- Comment #18 from Rhonda Kuiper <rkuiper@roundrocktexas.gov> --- We are eagerly waiting for this bug. Any status update? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125076|0 |1 is obsolete| | --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 129991 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129991&action=edit Bug 28832: Don't batch modify fields that we don't update In bug 27837 we made sure to always pass through the permanent_location if it was passed in unlike other fields which are not passed if they have no value. During batch mod, however, fields that aren't editied have no value, so forcing permanent_location to pass through forces blanking it. This patch alters the script to only pass thgouhr for edit the fields that have been updated or cleared. To test: 1 - In frameworks add a new subfield to 952, "C" - make it editable in items tab and visible in intranet/editor 2 - In mappings map that subfield to items.permanent_location 3 - Set an item to have differing shelving location and permanent_location 4 - This saves correctly for an individual item 5 - Edit the item using Tools->batch item modification, updating the note field 6 - Note the permanet_location is removed 7 - Check the DB, the field is set to NULL 8 - Apply patch 9 - Repeat 10 - Permanent location is not cleared 11 - Verify that clearing fields works as before, including permanent_location Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Deb Stephenson <dstephen@dubuque.lib.ia.us> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #125077|0 |1 is obsolete| | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 129992 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129992&action=edit Bug 28832: (follow-up) Handle regex fields too Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #127982|0 |1 is obsolete| | --- Comment #21 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 129993 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129993&action=edit Bug 28832: (follow-up) Don't remove false values, only empty strings Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 --- Comment #22 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 129994 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=129994&action=edit Bug 28832: (QA follow-up) Tiny comment spelling fix Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #23 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This works as expected for me at 21.05. QA scripts are also happy now I've fixed a minor typo spelling error. I'm happy this works now, Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.11 released in| | Status|Passed QA |Pushed to oldstable --- Comment #24 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Version(s)|21.05.11 |21.05.11,20.11.15 released in| | Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #25 from Victor Grousset/tuxayo <victor@tuxayo.net> --- 20.11.x also affected. Backported: Pushed to 20.11.x branch for 20.11.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28832 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #26 from wainuiwitikapark@catalyst.net.nz --- Not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org