Bug 5161

Summary: Patron attributes clearing if duplicate warning
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: major    
Priority: P5 - low CC: 1joynelson, f.demians, fiona.borthwick, gmcharlt, janet.mcgowan, jonathan.druart, lucy.vaux-harvey, martin.renvoize, r.delahunty, sally.healey, severine.queune, stephen.ayre
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25228
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Circulation function:
Bug Depends on: 20443    
Bug Blocks: 27420    
Attachments: Bug 5161: Keep patron's attributes on warning/duplicate
Bug 5161: Keep patron's attributes on warning/duplicate
Bug 5161: Keep patron's attributes on warning/duplicate

Description Nicole C. Engard 2010-08-23 21:09:16 UTC
When adding a patron record if you enter data in the additional attributes and you get an error about a field not being filled in the additional attributes get emptied out and you have to type them in again.  they should stay filled in like the rest of the form.
Comment 1 Owen Leonard 2010-08-27 13:48:19 UTC
Whoever takes this bug keep in mind that you have to account for the
possibility that the user has added an arbitrary number of new repeatable
attributes to the table via JavaScript.
Comment 2 Nicole C. Engard 2012-06-13 18:49:09 UTC
The same thing happens if you get a warning about the patron being a duplicate.
Comment 3 Jonathan Druart 2015-03-24 10:59:53 UTC
Mandatory fields are now checked in JS, but the issue still exists if a duplicate warning appears.
Comment 4 Stephen Ayre 2018-08-29 08:24:44 UTC
Losing pre-entered data for possible duplicate users is still an issue in 16.05. Is there any timeframe for a fix?
Comment 5 Jonathan Druart 2018-08-29 19:42:33 UTC
(In reply to Stephen Ayre from comment #4)
> Losing pre-entered data for possible duplicate users is still an issue in
> 16.05. Is there any timeframe for a fix?

The code is being rewritten to make it more robust, see bug 20443. I think it will be easier to fix this issue when we will have it pushed.
Comment 6 Ray Delahunty 2018-10-01 14:15:22 UTC
Data loss is occurring in quite a number of data fields already keyed (including what we found here today- the new user's expiry date). There are at least two other bug reports listing data loss in addition to this one for attributes. These are 15737 and 20762. Should I open a new bug report or will the changes being proposed fix all data loss in the various fields? I note that once the duplicate warning is made, it is possible to go down into the form and rekey the lost data before returning to the duplicate warning and accepting the new-user-create, and the data rekeyed remains.
Comment 7 Jonathan Druart 2019-05-30 02:59:31 UTC
Still valid for "Additional attributes" and "Messaging preferences".
Comment 8 Jonathan Druart 2019-05-30 02:59:46 UTC
*** Bug 20762 has been marked as a duplicate of this bug. ***
Comment 9 Jonathan Druart 2020-04-21 12:45:40 UTC
Created attachment 103372 [details] [review]
Bug 5161: Keep patron's attributes on warning/duplicate

When a patron is added or modified and a warning appears (duplicate,
inconsistent data, etc.) the form lost the patron's attributes.

Test plan:
Create some attribute types for patrons
Create a new patron, use an userid that already exists and fill the attributes
=> You get a warning and the attributes are kept
Modify the userid and save again
Edit the same patron
Modify the attributes, as well as the userid (to get the duplicate warning)
=> You get a warning and the attributes are kept with the modified
values
Modify the userid and save again
=> The new values are saved
Edit the attributes from the detail page (so not with the full edit form)
Modify them and save
=> The new values are saved
Comment 10 Jonathan Druart 2020-04-21 12:46:21 UTC
(In reply to Jonathan Druart from comment #7)
> Still valid for "Additional attributes" and "Messaging preferences".

Done with the patch for the attributes. The messaging preferences fix needs to be done on top of bug 18595.
Comment 11 David Nind 2020-04-21 20:45:34 UTC
Created attachment 103418 [details] [review]
Bug 5161: Keep patron's attributes on warning/duplicate

When a patron is added or modified and a warning appears (duplicate,
inconsistent data, etc.) the form lost the patron's attributes.

Test plan:
Create some attribute types for patrons
Create a new patron, use an userid that already exists and fill the attributes
=> You get a warning and the attributes are kept
Modify the userid and save again
Edit the same patron
Modify the attributes, as well as the userid (to get the duplicate warning)
=> You get a warning and the attributes are kept with the modified
values
Modify the userid and save again
=> The new values are saved
Edit the attributes from the detail page (so not with the full edit form)
Modify them and save
=> The new values are saved

Signed-off-by: David Nind <david@davidnind.com>
Comment 12 Katrin Fischer 2020-04-25 22:54:45 UTC
Created attachment 103717 [details] [review]
Bug 5161: Keep patron's attributes on warning/duplicate

When a patron is added or modified and a warning appears (duplicate,
inconsistent data, etc.) the form lost the patron's attributes.

Test plan:
Create some attribute types for patrons
Create a new patron, use an userid that already exists and fill the attributes
=> You get a warning and the attributes are kept
Modify the userid and save again
Edit the same patron
Modify the attributes, as well as the userid (to get the duplicate warning)
=> You get a warning and the attributes are kept with the modified
values
Modify the userid and save again
=> The new values are saved
Edit the attributes from the detail page (so not with the full edit form)
Modify them and save
=> The new values are saved

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2020-04-25 22:55:19 UTC
Great to see this old bug squashed!
Comment 14 Martin Renvoize (ashimema) 2020-04-27 10:45:01 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 15 Joy Nelson 2020-05-08 21:07:17 UTC
errors when applying to 19.11.x  please rebase if needed.  not backported