[Bug 28217] New: Several non-repeatable attributes when merging patrons
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Bug ID: 28217 Summary: Several non-repeatable attributes when merging patrons Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: major Priority: P5 - low Component: Patrons Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When using the patron merge feature it's possible to generate a patron with several non-repeatable attributes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21648 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21648 [Bug 21648] Patron Merge duplicates patron attributes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 120165 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120165&action=edit Bug 28217: Prevent several non-repeatable attributes to be merged When using the patron merge feature it's possible to generate a patron with several non-repeatable attributes. This patch prevents that. Test plan: Create 2 patron attribute types, one repeatable and one non-repeatable Create 2 patrons and add them repeatable attributes Add a non-repeatable attribute to one of them Merge the 2 patrons => It succeeds, the resulting patron has all the repeatable attribute and the non-repeatable one. Do it again but this time add non-repeatable to both patrons Merge them => It fails, you should see an error on the UI Merge failed! The following error was reported: Tried to add more than one non-repeatable attributes. type=TYPE value=VALUE. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120165|0 |1 is obsolete| | --- Comment #2 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 120248 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120248&action=edit Bug 28217: Prevent several non-repeatable attributes to be merged When using the patron merge feature it's possible to generate a patron with several non-repeatable attributes. This patch prevents that. Test plan: Create 2 patron attribute types, one repeatable and one non-repeatable Create 2 patrons and add them repeatable attributes Add a non-repeatable attribute to one of them Merge the 2 patrons => It succeeds, the resulting patron has all the repeatable attribute and the non-repeatable one. Do it again but this time add non-repeatable to both patrons Merge them => It fails, you should see an error on the UI Merge failed! The following error was reported: Tried to add more than one non-repeatable attributes. type=TYPE value=VALUE. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #3 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Works great, message quite clear :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120248|0 |1 is obsolete| | --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 120325 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120325&action=edit Bug 28217: Prevent several non-repeatable attributes to be merged When using the patron merge feature it's possible to generate a patron with several non-repeatable attributes. This patch prevents that. Test plan: Create 2 patron attribute types, one repeatable and one non-repeatable Create 2 patrons and add them repeatable attributes Add a non-repeatable attribute to one of them Merge the 2 patrons => It succeeds, the resulting patron has all the repeatable attribute and the non-repeatable one. Do it again but this time add non-repeatable to both patrons Merge them => It fails, you should see an error on the UI Merge failed! The following error was reported: Tried to add more than one non-repeatable attributes. type=TYPE value=VALUE. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #5 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|21.05.00 |21.05.00,20.11.06 released in| | --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Status|Pushed to stable |Pushed to oldstable Version(s)|21.05.00,20.11.06 |21.05.00,20.11.06,20.05.12 released in| | --- Comment #7 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED --- Comment #8 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Can't backport to 19.11.x: can't solve a conflict on the tests. Even after adding some missing variables my $anonymous = $builder->build( { source => 'Borrower', }, ); my $anonymous_patron = Koha::Patrons->find( $anonymous->{borrowernumber} ); I get # Failed test 'Test Koha::Patrons::merge' # at t/db_dependent/Koha/Patrons.t line 1801. The method Koha::Patron->extended_attributes is not covered by tests! If there is an interest in having this backported, please submit a patch for 19.11. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Christopher Brannon <cbrannon@cdalibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cbrannon@cdalibrary.org --- Comment #9 from Christopher Brannon <cbrannon@cdalibrary.org> --- The problem I have with this patch is that it makes the feature completely useless if you have non-repeatable attributes. It doesn't offer a way to select attributes to keep. There are no choices in how this functions. You just get this feature taken away. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Christopher Brannon from comment #9)
The problem I have with this patch is that it makes the feature completely useless if you have non-repeatable attributes. It doesn't offer a way to select attributes to keep. There are no choices in how this functions. You just get this feature taken away.
On bug 21648 you said you had to hide the feature because it caused data corruption. With this patch the data integrity is preserved. In my opinion it goes to the right direction. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #11 from Christopher Brannon <cbrannon@cdalibrary.org> --- Yes. It DOES prevent corruption. That is a big issue. Just wish this didn't stop there, and made it usable for EVERYONE. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #12 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Hi, It seems the remaining issue warrants a follow-up ticket with a test plan that match this use case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #13 from Christopher Brannon <cbrannon@cdalibrary.org> --- https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21648 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- (In reply to Victor Grousset/tuxayo from comment #8)
Can't backport to 19.11.x: can't solve a conflict on the tests.
Just retried with the idea of not backporting the newt tests and rely on manual testing. Turns out that the fix depends on bug 20443 which in not in 19.11.x So 19.11.x still uses attribute() and C4::Members::Attributes::UpdateBorrowerAttribute() But this patch relies on extended_attributes() and add_extended_attribute() And changing the name don't do it :P The existing tests don't pass anymore. So here is some info in case someone need this for 19.11.x and bellow. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Mark Rogers <marcos.rogers@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marcos.rogers@gmail.com --- Comment #15 from Mark Rogers <marcos.rogers@gmail.com> --- Comment on attachment 120325 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=120325 Bug 28217: Prevent several non-repeatable attributes to be merged Thank you for catching this issue of non-repeatable attributes being repeated upon merge. I didn't realize it had been an issue until trying to merge records recently and running into the exception thrown by this patch. In my case, I was trying to merge two records for the same student; the non-repeatable attribute was the student's grade level. Would it be possible to change the default behavior to one of keeping the non-repeatable attribute (if it exists) of the patron record that was selected as the patron to keep? This would make the behavior the same as that of the standard patron fields, which also are non-repeatable. I apologize if this is not the right place to post this. Thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 --- Comment #16 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Mark Rogers from comment #15)
Comment on attachment 120325 [details] [review] Bug 28217: Prevent several non-repeatable attributes to be merged
Thank you for catching this issue of non-repeatable attributes being repeated upon merge. I didn't realize it had been an issue until trying to merge records recently and running into the exception thrown by this patch.
In my case, I was trying to merge two records for the same student; the non-repeatable attribute was the student's grade level.
Would it be possible to change the default behavior to one of keeping the non-repeatable attribute (if it exists) of the patron record that was selected as the patron to keep? This would make the behavior the same as that of the standard patron fields, which also are non-repeatable.
I apologize if this is not the right place to post this.
Thank you!
Mark, Since this bug is resolved, you will need to add your comments and votes on https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21648, where we are addressing this exact issue now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28217 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |29059 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29059 [Bug 29059] Keep non-repeatable attribute from patron to preserve -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org