Bugzilla – Attachment 42891 Details for
Bug 14811
Don't set permanent_location to CART or PROC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14811: Don't update permanent_location with CART or PROC
Bug-14811-Dont-update-permanentlocation-with-CART-.patch (text/plain), 2.83 KB, created by
Josef Moravec
on 2015-09-25 18:42:25 UTC
(
hide
)
Description:
Bug 14811: Don't update permanent_location with CART or PROC
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2015-09-25 18:42:25 UTC
Size:
2.83 KB
patch
obsolete
>From 69c187fab1578c024ef39dd7468672d03946345b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 14 Sep 2015 16:01:48 +0100 >Subject: [PATCH] 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> >--- > C4/Items.pm | 6 +++++- > t/db_dependent/Items.t | 12 +++++++++++- > 2 files changed, 16 insertions(+), 2 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index fe6905c..e11aa1b 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -2048,7 +2048,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'}) { >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index f96e4d3..f453aa3 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -41,7 +41,7 @@ my $location = 'My Location'; > > subtest 'General Add, Get and Del tests' => sub { > >- plan tests => 10; >+ plan tests => 14; > > # Start transaction > $dbh->{AutoCommit} = 0; >@@ -78,6 +78,16 @@ subtest 'General Add, Get and Del tests' => sub { > is( $getitem->{location}, $location, "The location should not have been modified" ); > is( $getitem->{permanent_location}, 'my permanent location', "The permanent_location should not have modified" ); > >+ ModItem({ location => $location }, $bibnum, $itemnumber); >+ $getitem = GetItem($itemnumber); >+ is( $getitem->{location}, $location, "The location should have been set to correct location" ); >+ is( $getitem->{permanent_location}, $location, "The permanent_location should have been set to location" ); >+ >+ ModItem({ location => 'CART' }, $bibnum, $itemnumber); >+ $getitem = GetItem($itemnumber); >+ is( $getitem->{location}, 'CART', "The location should have been set to CART" ); >+ is( $getitem->{permanent_location}, $location, "The permanent_location should not have been set to CART" ); >+ > $dbh->rollback; > }; > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14811
:
42527
|
42529
|
42891
|
42963