From 96fc7ea273d5a26a96df1dbe6ac67dc302d4166f 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Joonas Kylmälä --- 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.30.2