From 51f99688cf56eb9989e5fc876839d3dc7a50a9d0 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 22 Oct 2025 11:07:00 +0300 Subject: [PATCH] Bug 29326: Fix _BLANK_ test failing To test: Before this patch: 1. prove t/db_dependent/Koha/Item.t 2. Observe failure After this patch: 3. prove t/db_dependent/Koha/Item.t 4. Observe success --- Koha/Item.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Koha/Item.pm b/Koha/Item.pm index 96a97f9f6d8..91d3e65e4a4 100644 --- a/Koha/Item.pm +++ b/Koha/Item.pm @@ -2783,7 +2783,8 @@ FIXME: It should return I<$self>. See bug 35270. sub location_update_trigger { my ( $self, $action ) = @_; - if (my $new_location = $self->_check_location_update_rules($action)) { + my $new_location = $self->_check_location_update_rules($action); + if (defined $new_location) { my $messages = { 'ItemLocationUpdated' => { from => $self->location, @@ -2815,8 +2816,8 @@ sub _check_location_update_rules { if (defined($update_loc_rules->{'_ALL_'})) { return $self->_check_location_update_rule($update_loc_rules->{'_ALL_'}); } - elsif (defined($update_loc_rules->{$self->location//''})) { - return $self->_check_location_update_rule($update_loc_rules->{$self->location}); + elsif (defined($update_loc_rules->{$self->location||'_BLANK_'})) { + return $self->_check_location_update_rule($update_loc_rules->{$self->location||'_BLANK_'}); } elsif (defined($update_loc_rules->{'_DEFAULT_'})) { return $self->_check_location_update_rule($update_loc_rules->{'_DEFAULT_'}); -- 2.34.1