Bug 34711 - Remove use of onclick for opac-privacy.pl
Summary: Remove use of onclick for opac-privacy.pl
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 34709
  Show dependency treegraph
 
Reported: 2023-09-05 02:49 UTC by David Cook
Modified: 2023-10-12 16:01 UTC (History)
1 user (show)

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


Attachments
Bug 34711: Remove use of onclick for opac-privacy.pl (4.13 KB, patch)
2023-09-05 05:00 UTC, David Cook
Details | Diff | Splinter Review
Bug 34711: Remove use of onclick for opac-privacy.pl (4.18 KB, patch)
2023-09-05 10:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34711: Remove use of onclick for opac-privacy.pl (4.24 KB, patch)
2023-09-17 14:32 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-09-05 02:49:08 UTC
Like bug 34570, we want to get rid of "onclick".

In this case, I'm targeting the buttons in opac-privacy.pl
Comment 1 David Cook 2023-09-05 05:00:58 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2023-09-05 10:54:46 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2023-09-17 14:32:52 UTC
Created attachment 155760 [details] [review]
Bug 34711: Remove use of onclick for opac-privacy.pl

This change removes the "onclick" attribute for the buttons
on opac-privacy.pl.

Note: The Javascript is placed in a separate file, which is
the preferred way for Javascript to be handled by
Content-Security-Policy

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OPACPrivacy
2. Set syspref to "Allow"
3. Go to http://localhost:8080/cgi-bin/koha/opac-privacy.pl
4. The confirmation modal appears and "OK" and "Cancel" buttons work as
   expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Tomás Cohen Arazi 2023-09-18 15:04:18 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 5 Fridolin Somers 2023-09-18 20:48:44 UTC
Pushed to 23.05.x for 23.05.04
Comment 6 Matt Blenkinsop 2023-10-12 16:01:00 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x