From 62fa4937ceb633b2e4548b6000a90e2c02b58620 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=utf8 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ä Signed-off-by: Tomas Cohen Arazi --- 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.39.5