]> git.koha-community.org Git - koha.git/commit
Bug 28832: Don't batch modify fields that we don't update
authorNick Clemens <nick@bywatersolutions.com>
Mon, 9 Aug 2021 16:28:16 +0000 (16:28 +0000)
committerVictor Grousset/tuxayo <victor@tuxayo.net>
Sun, 20 Feb 2022 22:15:07 +0000 (23:15 +0100)
commit8c2e32976a32ed7bf6f033d29a8f47f7783c548b
treeea81f6ce879e41daa3aac990b93d7892b1fbb593
parent5e7fa5d7c8fcf7dcb14a0c123a6de84b9d4649a1
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>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit ba9713ba3a2d8fa5b94211dbc1e6003517079578)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
tools/batchMod.pl