Bug 34571 - Remove use of onclick for ExpandField
Summary: Remove use of onclick for ExpandField
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: David Cook
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks: 20397
  Show dependency treegraph
 
Reported: 2023-08-18 03:51 UTC by David Cook
Modified: 2023-12-28 20:47 UTC (History)
1 user (show)

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


Attachments
Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors (8.28 KB, patch)
2023-08-18 04:35 UTC, David Cook
Details | Diff | Splinter Review
Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors (8.34 KB, patch)
2023-08-18 06:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors (8.39 KB, patch)
2023-08-25 11:53 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 David Cook 2023-08-18 03:51:54 UTC
Like bug 34570, we want to get rid of "onclick".

In this case, I'm targeting ExpandField.
Comment 1 David Cook 2023-08-18 04:24:49 UTC
Actually this one needs to be in both Cataloguing and Authorities...
Comment 2 David Cook 2023-08-18 04:35:06 UTC
Created attachment 154584 [details] [review]
Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors

This change replaces the onclick HTML attribute with a Javascript binding
to make it more in line with Koha conventions and make it CSP compatible.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Try hiding/unhiding fields
3. Try cloning fields and hiding/unhiding those too
4. Note that everything works as expected
5. Do the same thing for authorities by going to
http://localhost:8081/cgi-bin/koha/authorities/authorities.pl?authtypecode=#
Comment 3 Owen Leonard 2023-08-18 06:45:07 UTC
Created attachment 154586 [details] [review]
Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors

This change replaces the onclick HTML attribute with a Javascript binding
to make it more in line with Koha conventions and make it CSP compatible.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Try hiding/unhiding fields
3. Try cloning fields and hiding/unhiding those too
4. Note that everything works as expected
5. Do the same thing for authorities by going to
http://localhost:8081/cgi-bin/koha/authorities/authorities.pl?authtypecode=#

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 4 Katrin Fischer 2023-08-25 11:53:56 UTC
Created attachment 154803 [details] [review]
Bug 34571: Remove use of "onclick" for ExpandField in cataloguing editors

This change replaces the onclick HTML attribute with a Javascript binding
to make it more in line with Koha conventions and make it CSP compatible.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Try hiding/unhiding fields
3. Try cloning fields and hiding/unhiding those too
4. Note that everything works as expected
5. Do the same thing for authorities by going to
http://localhost:8081/cgi-bin/koha/authorities/authorities.pl?authtypecode=#

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Tomás Cohen Arazi 2023-08-30 13:06:54 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-08-30 20:21:43 UTC
Pushed to 23.05.x for 23.05.04
Comment 7 Matt Blenkinsop 2023-08-31 10:47:23 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x