Summary: | Unique attributes should not be copied when duplicating a patron | ||
---|---|---|---|
Product: | Koha | Reporter: | paxed <pasi.kallinen> |
Component: | Patrons | Assignee: | paxed <pasi.kallinen> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | minor | ||
Priority: | P5 - low | CC: | fridolin.somers, gmcharlt, katrin.fischer, kyle.m.hall, lucas, m.de.rooy, martin.renvoize |
Version: | master | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00,19.05.01
|
|
Bug Depends on: | |||
Bug Blocks: | 23283 | ||
Attachments: |
Bug 22910 - Do not copy unique patron attributes to duplicated patron
Bug 22910 - Do not copy unique patron attributes to duplicated patron Bug 22910 - Do not copy unique patron attributes to duplicated patron Bug 22910: Do not copy unique patron attributes to duplicated patron |
Description
paxed
2019-05-15 10:58:58 UTC
Created attachment 89782 [details] [review] Bug 22910 - Do not copy unique patron attributes to duplicated patron When creating a new patron by duplicating another, all of the patron attributes are also copied into the form. Some of those value may be unique, so don't copy those. 1) Create patron attribute types, one with "unique identifier", one without. 2) Create or a patron so it has values in both of those attributes. 3) Duplicate the patron 4) The edit form should retain the values from the "original" patron. 5) Apply patch. 6) Duplicate the patron - this time the attributes with unique values are cleared. Created attachment 89783 [details] [review] Bug 22910 - Do not copy unique patron attributes to duplicated patron When creating a new patron by duplicating another, all of the patron attributes are also copied into the form. Some of those value may be unique, so don't copy those. 1) Create patron attribute types, one with "unique identifier", one without. 2) Create or a patron so it has values in both of those attributes. 3) Duplicate the patron 4) The edit form should retain the values from the "original" patron. 5) Apply patch. 6) Duplicate the patron - this time the attributes with unique values are cleared. Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Very oddly, but this doesn't work for me. Can you please recheck? What I did: - Fresh database, created with reset_all - Created a new patron attribute ID = Identifier as unique - Edited my patron (42), setting it to uuu and SHOW_BARCODE to No - Saved - Duplicate patron - uuu remains ... also tried several restart_all and refreshes. (In reply to Katrin Fischer from comment #3) > Very oddly, but this doesn't work for me. Can you please recheck? > > What I did: > - Fresh database, created with reset_all > - Created a new patron attribute ID = Identifier as unique > - Edited my patron (42), setting it to uuu and SHOW_BARCODE to No > - Saved > - Duplicate patron > - uuu remains Retried it again, and it (still) works for me. No idea what's different (other than me not using kohadevbox and manually installing koha) I am not sure when I can retest - putting this back into the QA queue. Seems like this depends on the system - It works on my test environment, but on another the patron_attributes_form sub cannot see the $op variable. I have no idea why. Created attachment 90173 [details] [review] Bug 22910 - Do not copy unique patron attributes to duplicated patron When creating a new patron by duplicating another, all of the patron attributes are also copied into the form. Some of those value may be unique, so don't copy those. 1) Create patron attribute types, one with "unique identifier", one without. 2) Create or a patron so it has values in both of those attributes. 3) Duplicate the patron 4) The edit form should retain the values from the "original" patron. 5) Apply patch. 6) Duplicate the patron - this time the attributes with unique values are cleared. For some reason, on some environments the op-variable cannot be seen inside the patron_attributes_form, so just pass it in as a parameter. (In reply to paxed from comment #7) > Seems like this depends on the system - It works on my test environment, but > on another the patron_attributes_form sub cannot see the $op variable. I > have no idea why. With Plack, you should not use the $op from global level in a subroutine. You should pass it. Which you do now and that is fine! Created attachment 90218 [details] [review] Bug 22910: Do not copy unique patron attributes to duplicated patron When creating a new patron by duplicating another, all of the patron attributes are also copied into the form. Some of those value may be unique, so don't copy those. 1) Create patron attribute types, one with "unique identifier", one without. 2) Create or a patron so it has values in both of those attributes. 3) Duplicate the patron 4) The edit form should retain the values from the "original" patron. 5) Apply patch. 6) Duplicate the patron - this time the attributes with unique values are cleared. Signed-off-by: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Side note: * Commit title does not start with 'Bug XXXXX: ' - 24453d52d0 Fixed (In reply to Marcel de Rooy from comment #11) > Side note: > * Commit title does not start with 'Bug XXXXX: ' - 24453d52d0 > > Fixed Whoops, thanks! Nice work! Pushed to master for 19.11.00 Pushed to 19.05.x for 19.05.01 backported to 18.11.x for 18.11.07 |