Bug 27627 - Fix invalid HTML in OPAC results XSLT: change spans to divs
Summary: Fix invalid HTML in OPAC results XSLT: change spans to divs
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 27613
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-04 17:04 UTC by Owen Leonard
Modified: 2022-02-25 14:41 UTC (History)
6 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:
22.05.00


Attachments
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs (13.33 KB, patch)
2021-02-04 17:24 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs (13.39 KB, patch)
2021-02-04 17:56 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 27627: (follow-up) Change one more span to div (1.17 KB, patch)
2021-02-04 18:49 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 27627: (follow-up) change div nested inside .type to span (6.13 KB, patch)
2021-02-05 23:52 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs (7.18 KB, patch)
2021-11-08 15:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs (7.24 KB, patch)
2021-11-11 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs (7.30 KB, patch)
2022-02-21 21:25 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 2021-02-04 17:04:22 UTC
There are many <span>s in MARC21slim2OPACResults.xsl which contain block-level elements, which is invalid. There's no reason for these not to be converted to <div>s.
Comment 1 Owen Leonard 2021-02-04 17:19:37 UTC
This bug is revealed but not caused by Bug 27613 because it adds <ul> to these spans. The validation error in question is:

Element ul not allowed as child of element span in this context.
Comment 2 Owen Leonard 2021-02-04 17:24:38 UTC
Created attachment 116330 [details] [review]
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs

This patch modifies the XSL template for OPAC search results in order to
improve HTML validation: Changing some <span>s to <div>s will prevent an
error when those <span>s contain block-level elements.

To test, apply the patch and restart_all if necessary.

- Confirm that OPACXSLTResultsDisplay is set to "default"
- Perform a catalog search in the OPAC.
- Validate the page source and confirm that there are no errors about
  "Element ul not allowed as child of element span in this context"

Note: another patch will address other validation errors.
Comment 3 Lucas Gass 2021-02-04 17:56:03 UTC
Created attachment 116332 [details] [review]
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs

This patch modifies the XSL template for OPAC search results in order to
improve HTML validation: Changing some <span>s to <div>s will prevent an
error when those <span>s contain block-level elements.

To test, apply the patch and restart_all if necessary.

- Confirm that OPACXSLTResultsDisplay is set to "default"
- Perform a catalog search in the OPAC.
- Validate the page source and confirm that there are no errors about
  "Element ul not allowed as child of element span in this context"

Note: another patch will address other validation errors.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Lucas Gass 2021-02-04 18:47:52 UTC
Owen, I signed off on this one too hastily. There is still one <span>, .results_summary .type that should be a <div>

Also, the display is now altered as each of the elements 'results_material_type', 'results_format', 'results_contents_literary' now displaying block instead of displaying inline 


https://snipboard.io/FNIiRL.jpg
Comment 5 Lucas Gass 2021-02-04 18:49:15 UTC
Created attachment 116334 [details] [review]
Bug 27627: (follow-up) Change one more span to div
Comment 6 Lucas Gass 2021-02-05 23:52:29 UTC
Created attachment 116438 [details] [review]
Bug 27627: (follow-up) change div nested inside .type  to span
Comment 7 Henry Bolshaw 2021-04-14 07:35:56 UTC
Hi Lucas and Owen, does this need signing off again? Have the issues Lucas raised been fixed by the follow-ups?

"Owen, I signed off on this one too hastily. There is still one <span>, .results_summary .type that should be a <div>

Also, the display is now altered as each of the elements 'results_material_type', 'results_format', 'results_contents_literary' now displaying block instead of displaying inline"
Comment 8 Katrin Fischer 2021-04-17 18:18:31 UTC
(In reply to Henry Bolshaw from comment #7)
> Hi Lucas and Owen, does this need signing off again? Have the issues Lucas
> raised been fixed by the follow-ups?
> 
> "Owen, I signed off on this one too hastily. There is still one <span>,
> .results_summary .type that should be a <div>
> 
> Also, the display is now altered as each of the elements
> 'results_material_type', 'results_format', 'results_contents_literary' now
> displaying block instead of displaying inline"

I think these sound like good catches - setting FQA
Comment 9 Owen Leonard 2021-11-08 15:54:52 UTC
Created attachment 127455 [details] [review]
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs

This patch modifies the XSL template for OPAC search results in order to
improve HTML validation: Changing some <span>s to <div>s will prevent an
error when those <span>s contain block-level elements.

To test, apply the patch and restart_all if necessary.

- Confirm that OPACXSLTResultsDisplay is set to "default"
- Perform a catalog search in the OPAC.
- Validate the page source and confirm that there are no errors about
  "Element ul not allowed as child of element span in this context"
Comment 10 Martin Renvoize 2021-11-11 15:07:26 UTC
Created attachment 127544 [details] [review]
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs

This patch modifies the XSL template for OPAC search results in order to
improve HTML validation: Changing some <span>s to <div>s will prevent an
error when those <span>s contain block-level elements.

To test, apply the patch and restart_all if necessary.

- Confirm that OPACXSLTResultsDisplay is set to "default"
- Perform a catalog search in the OPAC.
- Validate the page source and confirm that there are no errors about
  "Element ul not allowed as child of element span in this context"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2021-11-11 15:08:24 UTC
All works as expected now, nice bit of tidying up.
Comment 12 Katrin Fischer 2021-11-19 15:03:48 UTC
Right now waiting for its dependency.
Comment 13 Katrin Fischer 2022-02-21 21:25:52 UTC
Created attachment 130976 [details] [review]
Bug 27627: Fix invalid HTMl in OPAC results XSLT: change spans to divs

This patch modifies the XSL template for OPAC search results in order to
improve HTML validation: Changing some <span>s to <div>s will prevent an
error when those <span>s contain block-level elements.

To test, apply the patch and restart_all if necessary.

- Confirm that OPACXSLTResultsDisplay is set to "default"
- Perform a catalog search in the OPAC.
- Validate the page source and confirm that there are no errors about
  "Element ul not allowed as child of element span in this context"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Fridolin Somers 2022-02-24 23:07:43 UTC
We should do the same in OPAC details XSLT no ?
Comment 15 Fridolin Somers 2022-02-25 00:36:20 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄