From 46933e36a4eb62ea8ab609e15b1bbf2a096dc30f Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 19 Apr 2017 14:44:13 -0300 Subject: [PATCH] Bug 18339: (followup) Remove warnings on adding a patron modification This patch removes warnings raised because hash values existence is not checked before comparing them. As the sub is deleting fields that are similar from the modification, I considered the following use cases - Both fields are defined, need to compare values, should delete if they match - One of the fields is defined, the other isn't, discrepancy, should not delete. - Both fields are not defined, they match, should delete. --- opac/opac-memberentry.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 5f4cb4d..2f302b5 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -452,8 +452,11 @@ sub DelUnchangedFields { my $current_data = GetMember( borrowernumber => $borrowernumber ); foreach my $key ( keys %new_data ) { - if ( $current_data->{$key} eq $new_data{$key} ) { - delete $new_data{$key}; + if ( defined $new_data{ $key } && + defined $current_data->{$key} && + $current_data->{$key} eq $new_data{$key} ) { + + delete $new_data{ $key }; } } -- 2.7.4