Bug 34709

Summary: Eliminate event handler attributes in the OPAC
Product: Koha Reporter: David Cook <dcook>
Component: OPACAssignee: David Cook <dcook>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: victor
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20397
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38407
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35126, 34613, 34711, 34724, 34725, 34934, 34936, 34944, 34945, 34946, 34980    
Bug Blocks: 20397, 38364    

Description David Cook 2023-09-05 02:38:10 UTC
There aren't too many event handler attributes left in the OPAC, so I'm hoping to do a blitz on them and have this be the umbrella report.
Comment 1 Victor Grousset/tuxayo 2023-09-25 07:14:33 UTC
It seems all the listed dependencies are done, thanks for all the patches! :D
Comment 2 David Cook 2023-09-25 23:40:51 UTC
(In reply to Victor Grousset/tuxayo from comment #1)
> It seems all the listed dependencies are done, thanks for all the patches! :D

Thanks, Victor, but there are still unlisted dependencies left to go. I just haven't gotten around to raising all the reports yet. 

But there's not too many left to go I think. I'm on holidays a lot the next couple weeks, but I'll be getting back to this after that.
Comment 3 Owen Leonard 2023-09-27 15:13:29 UTC
I found these:
- opac-detail.tt
- opac-full-serial-issues.tt
- opac-shelves.tt
- clubs-tab.tt
- enroll.tt
- sci-main.tt
- sco-main.tt
Comment 4 David Cook 2023-10-03 23:26:16 UTC
Thanks for taking care of this, Owen. You're a legend. I haven't had time lately so really appreciate it.
Comment 5 David Cook 2023-10-03 23:29:09 UTC
Using the following I found one more instance:

egrep -R " on[a-z]+=" koha-tmpl/opac-tmpl/*

Bug 34980

Once we've pushed the dependent bugs, we'll be adhering to https://wiki.koha-community.org/wiki/Coding_Guidelines#JS9:_Avoid_the_use_of_event_attributes_like_.22onclick.22_to_attach_events in the OPAC!

It would also allow us to start using Content-Security-Policy in the OPAC...
Comment 6 Victor Grousset/tuxayo 2023-10-20 20:50:26 UTC
Thanks Owen for the additional patches. I finally sorted out of SCO and SCI work for Bug 34946. And Katrin and Tomas immediately jumped to QA and merge it!

So all OPAC instances fixed :D
Comment 7 David Cook 2023-10-22 22:22:15 UTC
(In reply to Victor Grousset/tuxayo from comment #6)
> Thanks Owen for the additional patches. I finally sorted out of SCO and SCI
> work for Bug 34946. And Katrin and Tomas immediately jumped to QA and merge
> it!
> 
> So all OPAC instances fixed :D

I just found 1 more last one ﷐[U+1F605]﷑
Comment 8 David Cook 2024-07-22 05:49:50 UTC
(In reply to David Cook from comment #7)
> (In reply to Victor Grousset/tuxayo from comment #6)
> > Thanks Owen for the additional patches. I finally sorted out of SCO and SCI
> > work for Bug 34946. And Katrin and Tomas immediately jumped to QA and merge
> > it!
> > 
> > So all OPAC instances fixed :D
> 
> I just found 1 more last one ﷐[U+1F605]﷑

See bug 35126
Comment 9 David Cook 2024-11-08 01:29:58 UTC
The following returns 0 results, so I think that we can mark this one as resolved. 

egrep -R " on[a-zA-Z]+=" --exclude-dir="greybox" koha-tmpl/opac-tmpl/