Bug 20053 - Drop type attribute "text/javascript" for `<script>` elements used in OPAC templates
Summary: Drop type attribute "text/javascript" for `<script>` elements used in OPAC te...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Indranil Das Gupta
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 20066
  Show dependency treegraph
 
Reported: 2018-01-21 17:08 UTC by Indranil Das Gupta
Modified: 2019-10-14 19:56 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Large patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Prevents warnings about type attribute being generated for `<script>` elements when testing the OPAC pages using W3C Validator for HTML5.
Version(s) released in:


Attachments
Bug 20053 - Drop type attribute "text/javascript" in OPAC templates (48.47 KB, patch)
2018-01-21 17:44 UTC, Indranil Das Gupta
Details | Diff | Splinter Review
Bug 20053: Drop type attribute "text/javascript" in OPAC templates (48.37 KB, patch)
2018-01-22 13:30 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20053: Drop type attribute "text/javascript" in OPAC templates (48.71 KB, patch)
2018-01-29 16:13 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 20053: (QA follow-up) Also drop language attribute in OPAC templates (1.08 KB, patch)
2018-01-29 16:13 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 20053: Drop type attribute "text/javascript" in OPAC templates (41.08 KB, patch)
2018-05-01 13:28 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 20053: Drop type attribute "text/javascript" in OPAC templates (41.14 KB, patch)
2018-06-04 16:32 UTC, Jon Knight
Details | Diff | Splinter Review
Bug 20053: Drop type attribute "text/javascript" in OPAC templates (41.49 KB, patch)
2018-06-04 17:47 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Indranil Das Gupta 2018-01-21 17:08:50 UTC
If you run the Koha OPAC pages through the W3C validator it generates warnings about type attribute "text/javascript", since W3C now officially describes this as obsolete in HTML5 but still conforming to the standard with warnings [1]

Since we are already pumping up HTML5 with <!DOCTYPE html>, I was thinking if we should consider an omnibus update to the following 47 templates so affected.

The 47 templates:

includes/calendar.inc
includes/columns_settings.inc
includes/datatables.inc
includes/doc-head-close.inc
includes/greybox.inc
includes/opac-bottom.inc
includes/password_check.inc
includes/slip-print.inc
modules/clubs/clubs-tab.tt
modules/clubs/enroll.tt
modules/opac-account.tt
modules/opac-advsearch.tt
modules/opac-auth-detail.tt
modules/opac-auth-MARCdetail.tt
modules/opac-auth.tt
modules/opac-basket.tt
modules/opac-course-details.tt
modules/opac-course-reserves.tt
modules/opac-detail.tt
modules/opac-downloadshelf.tt
modules/opac-full-serial-issues.tt
modules/opac-idref.tt
modules/opac-illrequests.tt
modules/opac-imageviewer.tt
modules/opac-MARCdetail.tt
modules/opac-memberentry.tt
modules/opac-messaging.tt
modules/opac-overdrive-search.tt
modules/opac-passwd.tt
modules/opac-password-recovery.tt
modules/opac-readingrecord.tt
modules/opac-request-article.tt
modules/opac-reserve.tt
modules/opac-results-grouped.tt
modules/opac-results.tt
modules/opac-review.tt
modules/opac-search-history.tt
modules/opac-shareshelf.tt
modules/opac-shelves.tt
modules/opac-showreviews.tt
modules/opac-suggestions.tt
modules/opac-tags.tt
modules/opac-topissues.tt
modules/opac-user.tt
modules/sco/help.tt
modules/sco/printslip.tt
modules/sco/sco-main.tt


Reference:

[1] https://www.w3.org/TR/2017/REC-html52-20171214/obsolete.html#warnings-for-obsolete-but-conforming-features
Comment 1 Indranil Das Gupta 2018-01-21 17:44:56 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2018-01-22 13:30:11 UTC Comment hidden (obsolete)
Comment 3 Indranil Das Gupta 2018-01-22 20:00:03 UTC
@Owen:

I've added the fix for the forbidden patterns detected by qa tools in a separate patch as you had suggested i.e. Bug 20066.
Comment 4 Julian Maurice 2018-01-29 16:13:34 UTC Comment hidden (obsolete)
Comment 5 Julian Maurice 2018-01-29 16:13:37 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2018-01-30 16:54:49 UTC
What about the staff interface?
Comment 7 Owen Leonard 2018-01-30 16:57:34 UTC
(In reply to Jonathan Druart from comment #6)
> What about the staff interface?

The staff client templates should be similarly modified, but with so many "move template javascript to the footer" patches in various stages of QA I think it should wait.
Comment 8 Jonathan Druart 2018-02-12 19:13:42 UTC
Hi Indranil, the patch does not longer apply, can you rebase?
It sounds like it would be better to regenerate it, I guess you wrote a small script?
Comment 9 Indranil Das Gupta 2018-02-12 20:18:50 UTC
I will get to it.
Comment 10 Owen Leonard 2018-05-01 13:28:54 UTC
Created attachment 74946 [details] [review]
Bug 20053: Drop type attribute "text/javascript" in OPAC templates

This patch is a reimplementation of the original from Indranil Das Gupta
and the QA follow-up from Julian Maurice. Original test plan:

Conformance rules for HTML5 is generating warnings for <script> element
with type="text/javascript" attribute when the OPAC page is checked
with W3C Validator. This patch removes the cause of these warnings.

Test plan
=========

1/ Paste the URL to your OPAC page (if it is hosted) to W3C Validator
   and watch about 10+ warnings being generated by the validator.

2/ Apply patch and re-submit the page to the Validator. The warnings
   would be gone.
Comment 11 Jon Knight 2018-06-04 16:32:13 UTC
Created attachment 75781 [details] [review]
Bug 20053: Drop type attribute "text/javascript" in OPAC templates

This patch is a reimplementation of the original from Indranil Das Gupta
and the QA follow-up from Julian Maurice. Original test plan:

Conformance rules for HTML5 is generating warnings for <script> element
with type="text/javascript" attribute when the OPAC page is checked
with W3C Validator. This patch removes the cause of these warnings.

Test plan
=========

1/ Paste the URL to your OPAC page (if it is hosted) to W3C Validator
   and watch about 10+ warnings being generated by the validator.

2/ Apply patch and re-submit the page to the Validator. The warnings
   would be gone.

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>
Comment 12 Jonathan Druart 2018-06-04 17:47:41 UTC
Created attachment 75783 [details] [review]
Bug 20053: Drop type attribute "text/javascript" in OPAC templates

This patch is a reimplementation of the original from Indranil Das Gupta
and the QA follow-up from Julian Maurice. Original test plan:

Conformance rules for HTML5 is generating warnings for <script> element
with type="text/javascript" attribute when the OPAC page is checked
with W3C Validator. This patch removes the cause of these warnings.

Test plan
=========

1/ Paste the URL to your OPAC page (if it is hosted) to W3C Validator
   and watch about 10+ warnings being generated by the validator.

2/ Apply patch and re-submit the page to the Validator. The warnings
   would be gone.

Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 13 Nick Clemens 2018-06-08 13:56:36 UTC
Pushed to master for 18.11, awesome work all!
Comment 14 Martin Renvoize 2018-06-11 09:05:08 UTC
This patch has been pushed to 18.05.x and will be in 18.05.01
Comment 15 Fridolin Somers 2018-06-14 13:22:06 UTC
Too much conflicts in 17.11.x.
Since its not critical, I choose not to backport