Bug 11913 - Attributes generate error log during member entry
Summary: Attributes generate error log during member entry
Status: RESOLVED DUPLICATE of bug 11184
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-10 03:35 UTC by Mark Tompsett
Modified: 2014-04-09 22:54 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 11913 - Attributes generate error log during member entry (2.07 KB, patch)
2014-03-10 03:37 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 11913 - [SIGNED-OFF] Attributes generate error log during member entry (2.26 KB, patch)
2014-03-11 09:12 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 11913 - [SIGNED-OFF] Attributes generate error log during member entry (2.43 KB, patch)
2014-03-17 15:54 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2014-03-10 03:35:12 UTC
SHOW_BCODE (or any other patron attribute) which is NULL will generate errors similar to:
[Sun Mar 09 23:30:50 2014] [error] [client 192.168.45.23] [Sun Mar  9 23:30:50 2014] memberentry.pl: Use of uninitialized value $_ in hash element at /home/mtompset/kohaclone/members/memberentry.pl line 814.
[Sun Mar 09 23:30:50 2014] [error] [client 192.168.45.23] [Sun Mar  9 23:30:50 2014] memberentry.pl: Use of uninitialized value in anonymous hash ({}) at /home/mtompset/kohaclone/members/memberentry.pl line 814.

This is in part due to a poor way of copying the hash.
Comment 1 Mark Tompsett 2014-03-10 03:37:30 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2014-03-11 09:12:47 UTC Comment hidden (obsolete)
Comment 3 Mark Tompsett 2014-03-15 01:56:11 UTC
Comment on attachment 25970 [details] [review]
Bug 11913 - Attributes generate error log during member entry

Matched signed off version identically. Probably just forgot to be obsoleted. :)
Comment 4 Jonathan Druart 2014-03-17 15:54:04 UTC
Created attachment 26411 [details] [review]
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 <digitalutvikling@gmail.com>
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 <jonathan.druart@biblibre.com>
The existing code is really weird, I did not find any usefulness to have
values in keys. No regression found.
Comment 5 Galen Charlton 2014-04-09 22:54:35 UTC

*** This bug has been marked as a duplicate of bug 11184 ***