Description
Joy Nelson
2012-03-01 16:29:45 UTC
Confirmed in master. I assume libraries are working around this by adding the correct value to items.permanent_location before/during import? Not sure. I can say that if they are not (or do not know to add it or edit the item to force a permanent location value) then using the CART feature in Koha will cause data loss. I continue to see this happen. (In reply to Owen Leonard from comment #1) > Confirmed in master. I assume libraries are working around this by adding > the correct value to items.permanent_location before/during import? Created attachment 42222 [details] [review] Bug 7634: Make the tests pass This patch just fixed a master bug, if your database already has some items.homebranch set to CPL Created attachment 42223 [details] [review] Bug 7634: Add tests Created attachment 42224 [details] [review] Bug 7634: Prevent permanent_location to be set to NULL if not defined The permanent_location is correctly filled when an item is added from the cataloguing module (routine set_item_default_location from cataloguing/additem.pl). But when records are imported, this filled is not managed. It's only on editing (_do_column_fixes_for_mod called from ModItem). This patch set the permanent_location item fields to the location value for all items created, even the imported ones. Test plan: 0/ Do not apply this patch 1/ Import a record with items using the "Stage MARC for import" tool 2/ Check the values for the permanent_location in the items table. They are set to NULL 3/ Apply this patch 4/ Repeat 2 and confirm that now the permanent_location values are set to the location values. Created attachment 42260 [details] [review] Bug 7634: Make the tests pass This patch just fixed a master bug, if your database already has some items.homebranch set to CPL Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Created attachment 42261 [details] [review] \# Attachment to Bug 7634 - Permanent Location (shelving location) is NULL when Import MARC records tool is used Bug 7634: Add tests Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Created attachment 42262 [details] [review] Bug 7634: Prevent permanent_location to be set to NULL if not defined The permanent_location is correctly filled when an item is added from the cataloguing module (routine set_item_default_location from cataloguing/additem.pl). But when records are imported, this filled is not managed. It's only on editing (_do_column_fixes_for_mod called from ModItem). This patch set the permanent_location item fields to the location value for all items created, even the imported ones. Test plan: 0/ Do not apply this patch 1/ Import a record with items using the "Stage MARC for import" tool 2/ Check the values for the permanent_location in the items table. They are set to NULL 3/ Apply this patch 4/ Repeat 2 and confirm that now the permanent_location values are set to the location values. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Question: should we provide an update database to fix the proble on existing databases? Something like: If the location is not empty or CART or PROC, copy to permanent_location. Created attachment 42495 [details] [review] [PASSED QA] Bug 7634: Make the tests pass This patch just fixed a master bug, if your database already has some items.homebranch set to CPL Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 42496 [details] [review] [PASSED QA] Bug 7634: Add tests Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 42497 [details] [review] [PASSED QA] Bug 7634: Prevent permanent_location to be set to NULL if not defined The permanent_location is correctly filled when an item is added from the cataloguing module (routine set_item_default_location from cataloguing/additem.pl). But when records are imported, this filled is not managed. It's only on editing (_do_column_fixes_for_mod called from ModItem). This patch set the permanent_location item fields to the location value for all items created, even the imported ones. Test plan: 0/ Do not apply this patch 1/ Import a record with items using the "Stage MARC for import" tool 2/ Check the values for the permanent_location in the items table. They are set to NULL 3/ Apply this patch 4/ Repeat 2 and confirm that now the permanent_location values are set to the location values. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> I filed bug 14811 to deal with a related problem. Patches pushed to master. Thanks Jonathan! Pushed to 3.20.x will be in 3.20.4 pushed to 3.18.x will be in 3.18.11 |