Bug 7634: Prevent permanent_location to be set to NULL if not defined
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 2 Sep 2015 13:28:52 +0000 (14:28 +0100)
committerChris Cormack <chris@bigballofwax.co.nz>
Tue, 22 Sep 2015 17:48:35 +0000 (05:48 +1200)
commit3d74a820b23b7b912dea969f88a865bc714be50c
treeb5a78bc7a1699a9682d06f48e8daa46e093a029d
parentcf88d263353ef5305d8e34097310eeeac520dba1
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>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit a2ca59efb877945f7b2ebc92e7643d4cdaf9d4e1)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
C4/Items.pm