[
https://issues.apache.org/jira/browse/WW-5847?focusedWorklogId=1053295&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1053295
]
ASF GitHub Bot logged work on WW-5847:
--------------------------------------
Author: ASF GitHub Bot
Created on: 07/Nov/26 19:47
Start Date: 07/Nov/26 19:47
Worklog Time Spent: 10m
Work Description: sonarqubecloud[bot] commented on PR #2127:
URL: https://github.com/apache/struts/pull/2127#issuecomment-6712187274
## [](https://sonarcloud.io/dashboard?id=apache_struts&pullRequest=2127)
**Quality Gate passed**
Issues
 [0 New
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2127&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted
issues](https://sonarcloud.io/project/issues?id=apache_struts&pullRequest=2127&issueStatuses=ACCEPTED)
Measures
 [0 Security
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_struts&pullRequest=2127&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [93.3% Coverage on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2127&metric=new_coverage&view=list)
 [0.0% Duplication on New
Code](https://sonarcloud.io/component_measures?id=apache_struts&pullRequest=2127&metric=new_duplicated_lines_density&view=list)
<!
Issue Time Tracking
-------------------
Worklog Id: (was: 1053295)
Time Spent: 50m (was: 40m)
> doubleselect: preselection in the second list with doubleMultiple has never
> worked
> ----------------------------------------------------------------------------------
>
> Key: WW-5847
> URL: https://issues.apache.org/jira/browse/WW-5847
> Project: Struts 2
> Issue Type: Bug
> Components: Core Tags
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 6.13.0, 7.5.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> {{doubleselect.ftl}} in the simple theme preselects the second list's current
> value inside the generated script. The single-value branch writes
> {{doubleNameValue}} as a quoted string literal. The branch taken when
> {{doubleMultiple}} is set writes it unquoted, as the loop bound and in the
> comparison, so a plain {{String}} becomes a bare identifier and the script
> fails on page load; a {{Collection}} renders through {{toString}} with the
> same result, and a {{String[]}} fails the template render. The branch is also
> chosen by an existence check, so {{doubleMultiple="false"}} takes it too.
> Present since WW-2809 (2.1.8). {{support/struts-6-x-x}} carries the identical
> template. The xhtml theme includes the simple template; the html5 theme
> renders a placeholder for this tag and is unaffected.
> h2. Proposed change
> * Normalise {{doubleNameValue}} in {{DoubleListUIBean}} to a list (from a
> {{String}}, a {{Collection}} or an array) and emit it in the script as an
> array of quoted, JS-escaped string literals, as the single-value branch
> already does for one value.
> * Select the branch on the boolean value of {{doubleMultiple}}, not on its
> presence.
> h2. Compatibility
> Preselecting several values in the second list works. The single-value path
> renders as before.
> h2. Tests
> * A {{String}}, a {{Collection}} and a {{String[]}} under
> {{doubleMultiple="true"}} each render a quoted list and preselect the
> matching options.
> * {{doubleMultiple="false"}} renders the single-value path.
> * The existing DoubleSelect fixtures keep passing.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)