[
https://issues.apache.org/jira/browse/WW-5780?focusedWorklogId=1047743&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1047743
]
ASF GitHub Bot logged work on WW-5780:
--------------------------------------
Author: ASF GitHub Bot
Created on: 16/Oct/26 05:18
Start Date: 16/Oct/26 05:18
Worklog Time Spent: 10m
Work Description: lukaszlenart opened a new pull request, #2025:
URL: https://github.com/apache/struts/pull/2025
Fixes [WW-5780](https://issues.apache.org/jira/browse/WW-5780)
## Problem
`template/html5/checkboxlist.ftl` never closed the checkbox `<input>`, so
the rendered markup looked like:
```html
<input type="checkbox" name="collection" value="hello"
id="collection-1"<label for="collection-1" class="checkboxLabel">world</label>
```
The browser read `<label`, `for` and `class` as attribute names on the
input, so no `label` element was created. Clicking the item text did not toggle
the checkbox, and assistive technology had no label for it. This has shipped
since the html5 theme was added in 7.2.0 (WW-5444).
## Fix
Close the input with `/>`, the same way `template/html5/radiomap.ftl` does.
## Tests
- New `CheckboxListTest#testMultipleHtml5` compares the complete html5
output against the new `CheckboxList-2-html5.txt` fixture. The existing html5
tests only checked that expected substrings appeared, so they could not catch
broken markup. The new test failed without the fix (each `/>` before `<label`
was missing) and passes with it.
- `mvn test -pl core`: 3473 tests, 0 failures.
The duplicated `class`/`style` attributes in checkboxlist are a separate
issue, tracked in WW-5781 and not addressed here.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Issue Time Tracking
-------------------
Worklog Id: (was: 1047743)
Remaining Estimate: 0h
Time Spent: 10m
> html5 theme checkboxlist never closes the checkbox input element
> ----------------------------------------------------------------
>
> Key: WW-5780
> URL: https://issues.apache.org/jira/browse/WW-5780
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Tags
> Reporter: Lukasz Lenart
> Priority: Major
> Fix For: 7.5.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The {{html5}} theme template {{template/html5/checkboxlist.ftl}} emits each
> {{<input type="checkbox" ...}} without a closing {{/>}} — the
> {{dynamic-attributes.ftl}} include is followed directly by {{<label}}.
> Rendering {{<s:checkboxlist theme="html5" name="collection" list="list"
> listKey="top[0]" listValue="top[1]" cssClass="myClass"
> cssStyle="width:150px"/>}} produces:
> {code:html}<input type="checkbox" name="collection" value="hello"
> id="collection-1" class="myClass" style="width:150px" class="myClass"
> style="width:150px"<label for="collection-1"
> class="checkboxLabel">world</label>
> {code}
> The browser parses {{<label}}, {{for}} and {{class}} as attribute names of
> the input, so no {{label}} element is created: clicking the item text does
> not toggle the checkbox and assistive technology loses the label.
> Present since the html5 theme was added (WW-5444), i.e. released in 7.2.0.
> {{CheckboxListTest.testGenericHtml5}} only checks that expected substrings
> appear, so it does not catch malformed markup.
> Fix: close the input as {{template/html5/radiomap.ftl}} already does, and add
> a full expected-output fixture for the html5 checkboxlist.
> The duplicated {{class}}/{{style}} attributes in the output above are tracked
> separately.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)