Bug 34570

Summary: Remove use of onclick for PopupMARCFieldDoc()
Product: Koha Reporter: David Cook <dcook>
Component: Architecture, internals, and plumbingAssignee: David Cook <dcook>
Status: RESOLVED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, m.de.rooy
Version: Main   
Hardware: All   
OS: All   
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
Circulation function:
Bug Depends on:    
Bug Blocks: 20397    
Attachments: Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()

Description David Cook 2023-08-18 02:45:30 UTC
We can't use "onclick" attributes with CSP and we generally try to avoid them in Koha.

This report targets the PopupMARCFieldDoc() function in the cataloguing editor.
Comment 1 David Cook 2023-08-18 03:04:18 UTC
Created attachment 154583 [details] [review]
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()

This change removes the "onclick" attribute for the MARC doc
link in the cataloguing editor.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Click on the question mark (?) next to any of the MARC fields
3. Press the "Repeat this tag" button
4. Click on the question mark (?) on the cloned MARC field
5. Note that both times it worked
Comment 2 Owen Leonard 2023-08-18 06:23:27 UTC
Created attachment 154585 [details] [review]
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()

This change removes the "onclick" attribute for the MARC doc
link in the cataloguing editor.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Click on the question mark (?) next to any of the MARC fields
3. Press the "Repeat this tag" button
4. Click on the question mark (?) on the cloned MARC field
5. Note that both times it worked

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Marcel de Rooy 2023-08-25 09:50:34 UTC
Filled assignee :)
Comment 4 Marcel de Rooy 2023-08-25 09:52:39 UTC
Created attachment 154792 [details] [review]
Bug 34570: Remove use of "onclick" for PopupMARCFieldDoc()

This change removes the "onclick" attribute for the MARC doc
link in the cataloguing editor.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=#
2. Click on the question mark (?) next to any of the MARC fields
3. Press the "Repeat this tag" button
4. Click on the question mark (?) on the cloned MARC field
5. Note that both times it worked

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Tomás Cohen Arazi (tcohen) 2023-08-30 13:06:50 UTC
Pushed to master for 23.11.

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

Pushed to oldstable for 22.11.x