Bug 31251

Summary: "Clear" patron attribute link does not work
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Staff interfaceAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, lucas, victor
Version: unspecified   
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:
22.11.00,22.05.06,21.11.12
Attachments: Bug 31251: Use jQuery val() to clear_entry
Bug 31251: Use jQuery val() to clear_entry
Bug 31251: Use jQuery val() to clear_entry

Description Jonathan Druart 2022-07-28 07:24:50 UTC
On the patron edit view there is a "Clear" link to reset the value of an attribute.
It does no longer work, nothing happens and no error in the console.
Comment 1 Lucas Gass 2022-07-28 18:17:04 UTC
I think it is because we should use .val('') instead of .attr('value' , '').
Comment 2 Lucas Gass 2022-07-28 18:21:19 UTC
Created attachment 138223 [details] [review]
Bug 31251: Use jQuery val() to clear_entry

1. Add some patron attributes that are textarea and some that have an AV category so they are select dropdowns
2. Go to the patron form and add some values to the patron attributes
3. Use the "Clear" button to try and clear the values, doesnt work.
4. Apply patch
5. Try clearing values from patron attributes that are both select dropdowns and textarea. The "Clear" button should work.
Comment 3 David Nind 2022-07-29 00:25:28 UTC
Created attachment 138241 [details] [review]
Bug 31251: Use jQuery val() to clear_entry

1. Add some patron attributes that are textarea and some that have an AV category so they are select dropdowns
2. Go to the patron form and add some values to the patron attributes
3. Use the "Clear" button to try and clear the values, doesnt work.
4. Apply patch
5. Try clearing values from patron attributes that are both select dropdowns and textarea. The "Clear" button should work.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2022-07-30 18:30:11 UTC
Created attachment 138392 [details] [review]
Bug 31251: Use jQuery val() to clear_entry

1. Add some patron attributes that are textarea and some that have an AV category so they are select dropdowns
2. Go to the patron form and add some values to the patron attributes
3. Use the "Clear" button to try and clear the values, doesnt work.
4. Apply patch
5. Try clearing values from patron attributes that are both select dropdowns and textarea. The "Clear" button should work.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi 2022-08-01 12:11:25 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 6 Lucas Gass 2022-09-29 15:09:44 UTC
Backported to 22.05.x for 22.05.06
Comment 7 Victor Grousset/tuxayo 2022-10-13 15:31:40 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document it seems, marking resolved.
Comment 8 Arthur Suzuki 2022-10-22 22:09:17 UTC
Thanks!

Pushed to 21.11 for 21.11.12