Bug 24391

Summary: Remove event attributes from patron clubs edit template
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: 1joynelson, hayleypelham, lucas, testopia
Version: Main   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/clubs/templates-add-modify.pl
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.03, 19.05.08
Circulation function:
Bug Depends on:    
Bug Blocks: 18530    
Attachments: Bug 24391: Remove event attributes from patron clubs templates
Bug 24391: Remove event attributes from patron clubs edit template
Bug 24391: Remove event attributes from patron clubs edit template
Bug 24391: Remove event attributes from patron clubs edit template

Description Owen Leonard 2020-01-09 17:44:58 UTC
The template for adding/editing patron clubs has several instances of "onclick," in violation of coding guidelines.

https://wiki.koha-community.org/wiki/Coding_Guidelines#JS9:_Avoid_the_use_of_event_attributes_like_.22onclick.22_to_attach_events

They should be removed in favor of defining events in JavaScript instead of markup.
Comment 1 Owen Leonard 2020-01-09 17:54:47 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2020-01-09 19:42:20 UTC
Created attachment 97140 [details] [review]
Bug 24391: Remove event attributes from patron clubs edit template

This patch removes "onclick" attributes from the template for adding and
editing patron club templates.

To test, apply the patch and go to Tools -> Patron clubs -> New club
template.

Test the process of adding and deleting both club and enrollment fields.
Test during the template add process and when editing an existing
template.
Comment 3 David Nind 2020-01-12 18:29:14 UTC
Created attachment 97270 [details] [review]
Bug 24391: Remove event attributes from patron clubs edit template

This patch removes "onclick" attributes from the template for adding and
editing patron club templates.

To test, apply the patch and go to Tools -> Patron clubs -> New club
template.

Test the process of adding and deleting both club and enrollment fields.
Test during the template add process and when editing an existing
template.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2020-01-14 22:28:41 UTC
Hi Owen, is the dependency correct here? It looks like there were patches on bug 18530 once, but there aren't now.
Comment 5 Katrin Fischer 2020-01-14 22:34:08 UTC
Created attachment 97373 [details] [review]
Bug 24391: Remove event attributes from patron clubs edit template

This patch removes "onclick" attributes from the template for adding and
editing patron club templates.

To test, apply the patch and go to Tools -> Patron clubs -> New club
template.

Test the process of adding and deleting both club and enrollment fields.
Test during the template add process and when editing an existing
template.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Owen Leonard 2020-01-15 00:55:03 UTC
(In reply to Katrin Fischer from comment #4)
> Hi Owen, is the dependency correct here?

Sorry, it should block, not depend on, 18530
Comment 7 Martin Renvoize (ashimema) 2020-01-15 09:26:25 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 8 Joy Nelson 2020-01-31 23:25:41 UTC
Pushed to 19.11.x branch for 19.11.03
Comment 9 Lucas Gass (lukeg) 2020-02-12 22:55:03 UTC
backported to 19.05.x for 19.05.08
Comment 10 Hayley Pelham 2020-02-13 22:57:00 UTC
Enhancement will not be backported to 18.11.x series.