Bug 5161 - Patron attributes clearing if duplicate warning
Summary: Patron attributes clearing if duplicate warning
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low major with 10 votes (vote)
Assignee: Jonathan Druart
QA Contact: Bugs List
URL:
Keywords:
: 20762 (view as bug list)
Depends on: 20443
Blocks: 27420
  Show dependency treegraph
 
Reported: 2010-08-23 21:09 UTC by Nicole C. Engard
Modified: 2021-01-13 11:17 UTC (History)
12 users (show)

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


Attachments
Bug 5161: Keep patron's attributes on warning/duplicate (4.08 KB, patch)
2020-04-21 12:45 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 5161: Keep patron's attributes on warning/duplicate (4.12 KB, patch)
2020-04-21 20:45 UTC, David Nind
Details | Diff | Splinter Review
Bug 5161: Keep patron's attributes on warning/duplicate (4.18 KB, patch)
2020-04-25 22:54 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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