From 282fb45f3000f2987dbb554a92e7d1bbe62b45fc Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Sun, 9 Mar 2014 23:19:50 -0400 Subject: [PATCH] Bug 11913 - Attributes generate error log during member entry In member/memberentry.pl, there were two lines like: my $newentry = { map { $_ => $entry->{$_} } %$entry }; These were in the 'sub patron_attributes_form'. They have been changed to: my $newentry = { %$entry }; Of course, indentation does not reflect actual indentation. They were discovered while testing another bug, which required editing a member record. TEST PLAN --------- 1) Make sure you have the SHOW_BCODE attribute. 2) Go edit a member. 3) Clear the SHOW_BCODE value. 4) Save. 5) Edit again. 6) Check the error log file. 7) apply patch. 8) Change the value for SHOW_BCODE (Yes/No) 9) Save. 10) Edit again. (tests change 1) 11) Clear the SHOW_BCODE 12) Save. 13) Edit again. (tests change 2) 14) Check the error log file. --- members/memberentry.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 429768a..7b5ca17 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -797,7 +797,7 @@ sub patron_attributes_form { }; if (exists $attr_hash{$attr_type->code()}) { foreach my $attr (@{ $attr_hash{$attr_type->code()} }) { - my $newentry = { map { $_ => $entry->{$_} } %$entry }; + my $newentry = { %$entry }; $newentry->{value} = $attr->{value}; $newentry->{password} = $attr->{password}; $newentry->{use_dropdown} = 0; @@ -811,7 +811,7 @@ sub patron_attributes_form { } } else { $i++; - my $newentry = { map { $_ => $entry->{$_} } %$entry }; + my $newentry = { %$entry }; if ($attr_type->authorised_value_category()) { $newentry->{use_dropdown} = 1; $newentry->{auth_val_loop} = GetAuthorisedValues($attr_type->authorised_value_category()); -- 1.7.9.5