Bug 33844: Fix is_denied_renewal
Going via result_set->has_column does cost actually nothing if
the object is already there.
Test plan:
Run again t/db_dependent/Koha/Item.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a215087a6a
)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
This commit is contained in:
parent
b315b82793
commit
c592b075f4
1 changed files with 2 additions and 0 deletions
|
@ -2044,6 +2044,8 @@ sub is_denied_renewal {
|
|||
my $denyingrules = C4::Context->yaml_preference('ItemsDeniedRenewal');
|
||||
return 0 unless $denyingrules;
|
||||
foreach my $field (keys %$denyingrules) {
|
||||
# Silently ignore bad column names; TODO we should validate elsewhere
|
||||
next if !$self->_result->result_source->has_column($field);
|
||||
my $val = $self->$field;
|
||||
if( !defined $val) {
|
||||
if ( any { !defined $_ } @{$denyingrules->{$field}} ){
|
||||
|
|
Loading…
Reference in a new issue