From 191a58f9eb4a8a84ccae3c70a9fafdcd2d7ecb37 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Sun, 9 Mar 2014 23:19:50 -0400 Subject: [PATCH] Bug 11913 - [SIGNED-OFF] 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. Signed-off-by: Magnus Enger Tested with the SHOW_BCODE attribute, setting it to empty, Yes and No. The patch removes the error log messages, as described. Signed-off-by: Jonathan Druart The existing code is really weird, I did not find any usefulness to have values in keys. No regression found. --- members/memberentry.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 28ab5e0..ff92447 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -781,7 +781,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; @@ -795,7 +795,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.10.4