Bug 31535: Fix warning - uninitialized value for location

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 <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2022-09-09 07:35:53 +00:00 committed by Tomas Cohen Arazi
parent 8ddec91211
commit 62fa4937ce
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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 );