[Bug 11184] New: Fix wrong attribute type cloning
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Bug ID: 11184 Summary: Fix wrong attribute type cloning Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: srdjan@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When building attributes list for the patron maintenance list, cloning is performed in suboptimal way that generates warnings. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 --- Comment #1 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 22664 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=22664&action=edit bug_11184: correct attribute cloning for the maint screen To test - Patron details entry page: * Have ExtendedPatronAttributes enabled. Check that "Additional attributes and identifiers" section behaves. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 --- Comment #2 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Galen, can I ask you to scrutinise this one please. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |srdjan@catalyst.net.nz |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #22664|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 24412 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24412&action=edit bug_11184: correct attribute cloning for the maint screen To test - Patron details entry page: * Have ExtendedPatronAttributes enabled. Check that "Additional attributes and identifiers" section behaves. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |katrin.fischer@bsz-bw.de --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Srdjan and Jonathan, could you provide more information on the effect of this patch? I have tested the patron attributes on memberentry.pl and it seems to work, but it's a bit hard to tell what to look out for. Also, the warnings in my logs seem the same before and after applying the patch. Also, shouldn't this line be changed as well? 825 my $newentry = { map { $_ => $entry->{$_} } %$entry }; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- The fix: my $newentry = { %$entry }; takes the hash and generates a copy. This is what: my $newentry = { map { $_ => $entry->{$_} } %$entry }; is supposed to do, but it does it wrong. It could be fixed by making it: my $newentry = { map { $_ => $entry->{$_} } keys %$entry }; However, mapping and access functions to copy are much likely to be slower than just straight copying. Instead of copying { k1 => v1, k2 => v2, ..., kn => vn } The broken code generates { k1 => v1, v1 => undef, k2 => v2, v2 => undef, ... kn => vn, vn => undef } This can create some weird errors if the value of any of those keys is undef. This is also twice the size of the hash. And yes, this fix should be applied to the other line as well. Hope this clarifies, Katrin. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24412|0 |1 is obsolete| | --- Comment #6 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 26619 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26619&action=edit bug_11184: correct attribute cloning for the maint screen To test - Patron details entry page: * Have ExtendedPatronAttributes enabled. Check that "Additional attributes and identifiers" section behaves. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26619|0 |1 is obsolete| | --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 26627 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26627&action=edit bug_11184: correct attribute cloning for the maint screen To test - Patron details entry page: * Have ExtendedPatronAttributes enabled. Check that "Additional attributes and identifiers" section behaves. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26627|0 |1 is obsolete| | --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 26702 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26702&action=edit [PASSED QA] Bug 11184: correct attribute cloning for the maint screen To test - Patron details entry page: * Have ExtendedPatronAttributes enabled. Check that "Additional attributes and identifiers" section behaves. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Tested with different types of patron attributes: - repeatable - linked to an authorized value - free text Tested editing, adding, removing one of multiple, adding multiple, etc. No regressions found. Passes all tests and QA script. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #26702|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 26703 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=26703&action=edit [PASSED QA] Bug 11184: correct attribute cloning for the maint screen To test - Patron details entry page: * Have ExtendedPatronAttributes enabled. Check that "Additional attributes and identifiers" section behaves. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Tested with different types of patron attributes: - repeatable - linked to an authorized value - free text Tested editing, adding, removing one of multiple, adding multiple, etc. No regressions found. Passes all tests and QA script. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #10 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Srdjan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 --- Comment #11 from Galen Charlton <gmcharlt@gmail.com> --- *** Bug 11913 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #12 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.10 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11184 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #13 from Kyle M Hall <kyle@bywatersolutions.com> --- Picked for 3.12.15 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org