Bug 24391 - Remove event attributes from patron clubs edit template
Summary: Remove event attributes from patron clubs edit template
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL: /cgi-bin/koha/clubs/templates-add-mod...
Keywords:
Depends on:
Blocks: 18530
  Show dependency treegraph
 
Reported: 2020-01-09 17:44 UTC by Owen Leonard
Modified: 2021-06-14 21:28 UTC (History)
5 users (show)

See Also:
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


Attachments
Bug 24391: Remove event attributes from patron clubs templates (3.79 KB, patch)
2020-01-09 17:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 24391: Remove event attributes from patron clubs edit template (3.79 KB, patch)
2020-01-09 19:42 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 24391: Remove event attributes from patron clubs edit template (3.84 KB, patch)
2020-01-12 18:29 UTC, David Nind
Details | Diff | Splinter Review
Bug 24391: Remove event attributes from patron clubs edit template (3.89 KB, patch)
2020-01-14 22:34 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 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 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 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.