[Bug 13602] New: Username/password already exists when editing borrower attributes and messaging preferences
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Bug ID: 13602 Summary: Username/password already exists when editing borrower attributes and messaging preferences 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: olli-antti.kivilahti@jns.fi QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. AFTER THIS PATCH: Check_Userid() is not called when modifying or saving partial borrower properties. Userid is changed using a separate module. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 35404 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35404&action=edit Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. AFTER THIS PATCH: Check_Userid() is not called when modifying or saving partial borrower properties. -- 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=13602 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |olli-antti.kivilahti@jns.fi |ity.org | Severity|enhancement |normal --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Can you please describe how to reproduce this bug? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I don't have time to test this thoroughly, but I can confirm the problem: If you use the small 'edit' links for a section of the patron record instead of the 'edit' link in the toolbar, you can't save changes - as you get an error message: The following fields are wrong. Please fix them. Username/password already exists. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35404|0 |1 is obsolete| | --- Comment #4 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 35435 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35435&action=edit Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. AFTER THIS PATCH: Check_Userid() get the $userid from the new parameters, or if not present, from the koha.borrowers-table. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35435|0 |1 is obsolete| | --- Comment #5 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 35436 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35436&action=edit Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. REPLICATE THE ISSUE: 1. Find a Borrower. 2. Go to the details-tab. 3. Under "Patron messaging preferences" click edit to edit just the messaging preferences. 4. Just save, no need to make any modifications. 5. Observe the error "Username/password already exists" This happens to all/most of the sub-forms in the Borrower's Details-view. AFTER THIS PATCH: Check_Userid() get the $userid from the new parameters, or if not present, from the koha.borrowers-table. TEST FOR REGRESSION: 1. Edit a borrower normally. Notice no errors. 2. Edit a sub-form (Alternate address/Patron messaging preferences). Notice no errors. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35436|0 |1 is obsolete| | --- Comment #6 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 35437 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35437&action=edit Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. REPLICATE THE ISSUE: 1. Find a Borrower. 2. Go to the details-tab. 3. Under "Patron messaging preferences" click edit to edit just the messaging preferences. 4. Just save, no need to make any modifications. 5. Observe the error "Username/password already exists" This happens to all/most of the sub-forms in the Borrower's Details-view. AFTER THIS PATCH: Check_Userid() get the $userid from the new parameters, or if not present, from the koha.borrowers-table. TEST FOR REGRESSION: 1. Edit a borrower normally. Notice no errors. 2. Edit a sub-form (Alternate address/Patron messaging preferences). Notice no errors. DISCLAIMER: You are free to steal/rip/modify/hack this patch to your soul's extent without my permission. As long as it makes to Koha I am happy. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bob-ewart@bobsown.com --- Comment #7 from Owen Leonard <oleonard@myacpl.org> --- *** Bug 13649 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=13602 --- Comment #8 from Marc Véron <veron@veron.ch> --- Created attachment 35648 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35648&action=edit [Signed-off] Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. REPLICATE THE ISSUE: 1. Find a Borrower. 2. Go to the details-tab. 3. Under "Patron messaging preferences" click edit to edit just the messaging preferences. 4. Just save, no need to make any modifications. 5. Observe the error "Username/password already exists" This happens to all/most of the sub-forms in the Borrower's Details-view. AFTER THIS PATCH: Check_Userid() get the $userid from the new parameters, or if not present, from the koha.borrowers-table. TEST FOR REGRESSION: 1. Edit a borrower normally. Notice no errors. 2. Edit a sub-form (Alternate address/Patron messaging preferences). Notice no errors. DISCLAIMER: You are free to steal/rip/modify/hack this patch to your soul's extent without my permission. As long as it makes to Koha I am happy. Works as expected. Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35437|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 35650 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35650&action=edit [PASSED QA] Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. REPLICATE THE ISSUE: 1. Find a Borrower. 2. Go to the details-tab. 3. Under "Patron messaging preferences" click edit to edit just the messaging preferences. 4. Just save, no need to make any modifications. 5. Observe the error "Username/password already exists" This happens to all/most of the sub-forms in the Borrower's Details-view. AFTER THIS PATCH: Check_Userid() get the $userid from the new parameters, or if not present, from the koha.borrowers-table. TEST FOR REGRESSION: 1. Edit a borrower normally. Notice no errors. 2. Edit a sub-form (Alternate address/Patron messaging preferences). Notice no errors. DISCLAIMER: You are free to steal/rip/modify/hack this patch to your soul's extent without my permission. As long as it makes to Koha I am happy. Works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35648|0 |1 is obsolete| | Attachment #35650|0 |1 is obsolete| | --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 35651 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35651&action=edit [PASSED QA] Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences When editing a Patron's messaging preferences or borrower attributes, one cannot save changes because 'userid' is not given as a parameter. It shouldn't, but the Check_Userid($newdata{'userid'},$borrowernumber) -check must have it. REPLICATE THE ISSUE: 1. Find a Borrower. 2. Go to the details-tab. 3. Under "Patron messaging preferences" click edit to edit just the messaging preferences. 4. Just save, no need to make any modifications. 5. Observe the error "Username/password already exists" This happens to all/most of the sub-forms in the Borrower's Details-view. AFTER THIS PATCH: Check_Userid() get the $userid from the new parameters, or if not present, from the koha.borrowers-table. TEST FOR REGRESSION: 1. Edit a borrower normally. Notice no errors. 2. Edit a sub-form (Alternate address/Patron messaging preferences). Notice no errors. DISCLAIMER: You are free to steal/rip/modify/hack this patch to your soul's extent without my permission. As long as it makes to Koha I am happy. Works as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 --- Comment #11 from Jonathan Druart <jonathan.druart@biblibre.com> --- Comment on attachment 35651 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35651 [PASSED QA] Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences Review of attachment 35651: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=13602&attachment=35651) ----------------------------------------------------------------- ::: members/memberentry.pl @@ +329,5 @@
} } + # Check if the userid is unique. Userid might not always be present in the edited values list when editing certain sub-forms, so we need to dig for it a bit. + my $userid = $newdata{'userid'}; + $userid = $borrower_data->{userid} unless $userid; #Get the userid straight from the DB
In my opinion, my $userid = $newdata{userid} ? $newdata{userid} : $borrower_data->{userid}; or my $userid = $newdata{userid}; $userid ||= $borrower_data->{userid}; Would have been more readable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13655 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Ran into another problem here - if you leave the password/userid empty on creating a new organisation type patron, you get an error message. It should totally be possible to create users with no login or let Koha create the userid automatically. (Filed a new bug 13655) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #11)
Comment on attachment 35651 [details] [review] [PASSED QA] Bug 13602 - Username/password already exists when editing borrower attributes and messaging preferences
Review of attachment 35651 [details] [review]: -----------------------------------------------------------------
::: members/memberentry.pl @@ +329,5 @@
} } + # Check if the userid is unique. Userid might not always be present in the edited values list when editing certain sub-forms, so we need to dig for it a bit. + my $userid = $newdata{'userid'}; + $userid = $borrower_data->{userid} unless $userid; #Get the userid straight from the DB
In my opinion,
my $userid = $newdata{userid} ? $newdata{userid} : $borrower_data->{userid};
or
my $userid = $newdata{userid}; $userid ||= $borrower_data->{userid};
Would have been more readable.
We could even use the defined-or operator: my $userid = $newdata->{ userid } // $borrower_data->{ userid }; -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Olli! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Status|Pushed to Master |Pushed to Stable --- Comment #15 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.18.x will be in 3.18.4 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_3_16_candidate CC| |mtj@kohaaloha.com --- Comment #16 from Mason James <mtj@kohaaloha.com> --- (In reply to Chris Cormack from comment #15)
Pushed to 3.18.x will be in 3.18.4
Pushed to 3.16.x, will be in 3.16.8 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13602 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Stable |RESOLVED CC| |fridolyn.somers@biblibre.co | |m Depends on| |13502 --- Comment #17 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Depends on Bug 13502 which changed the behavior of Check_Userid with undefined $uid. Not needed for 3.14.x. By the way, why check userid when this data is unchanged (not in $newdata because not edited) ? Also, the flag $NoUpdateLogin manages whether or not the userid can be edited. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org