From 29b1ac033317f0893949e49149efa265df1b9681 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 9 Sep 2022 07:35:53 +0000 Subject: [PATCH] Bug 31535: Fix warning - uninitialized value for location Content-Type: text/plain; charset=utf-8 In Koha/Item.pm line 169 (line number has been changed) Test plan: You need location to be NULL when storing. Otherwise follow this reasoning: What happens when location is undefined? It is autovivified to empty string in the string compare (ne), so not equal to CART and PROC. The subcondition is true before and after this patch. Signed-off-by: Marcel de Rooy --- Koha/Item.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index e5d4bbccd6..d2f337772d 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -179,8 +179,7 @@ sub store { if ( exists $updated_columns{location} - and $self->location ne 'CART' - and $self->location ne 'PROC' + and ( !defined($self->location) or $self->location !~ /^(CART|PROC)$/ ) and not exists $updated_columns{permanent_location} ) { $self->permanent_location( $self->location ); -- 2.20.1