Bug 14811: Don't update permanent_location with CART or PROC

The permanent_location should not be set to CART or PROC when the item
is edited.
Otherwise we lost an important info.

Test plan:
0/ Set the ReturnToShelvingCart pref
1/ Create an item with location "on_my_shelf"
2/ Check the item in and out
3/ Look at the DB values, location should be "CART" and
permanent_location unchanged (on_my_shelf)
4/ Edit the item, add a note for instance
5/ Without this patch, the permanent_location is erased with 'CART' and
you have definitely lost the info.
With this patch, the permanent_location is unchanged.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 2a319e7ae2)
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Conflicts:
	t/db_dependent/Items.t
This commit is contained in:
Jonathan Druart 2015-09-14 16:01:48 +01:00 committed by Liz Rea
parent 6bc08252b4
commit f4002fb9b4
1 changed files with 5 additions and 1 deletions

View File

@ -2029,7 +2029,11 @@ sub _do_column_fixes_for_mod {
(not defined $item->{'withdrawn'} or $item->{'withdrawn'} eq '')) {
$item->{'withdrawn'} = 0;
}
if (exists $item->{'location'} && !$item->{'permanent_location'}) {
if (exists $item->{location}
and $item->{location} ne 'CART'
and $item->{location} ne 'PROC'
and not $item->{permanent_location}
) {
$item->{'permanent_location'} = $item->{'location'};
}
if (exists $item->{'timestamp'}) {