sameFormFieldsAsArray does not convert fields to arrays if all inputs are empty

Description

When sameFormFieldsAsArray is set to true, when all fields with the same name are empty, it's not converted to an array of empty strings (as expected). If only one of the fields is filled out, it's passed as a string, and the other empty strings are not passed as elements in an array. This broke portions of our application that had previously been working on 5.3.2+77.

It seems the fix that was added to correct didn't account for empty fields.

https://github.com/lucee/Lucee/blob/538a9c165f1a854e261b1f538d0dc113727eeebe/core/src/main/java/lucee/runtime/type/scope/ScopeSupport.java#L251

Updated the repro from the earlier issue to demonstrate: https://github.com/mjclemente/lucee-error-sameFormFieldsAsArray

Environment

CommandBox

Activity

Show:

Zac Spitzer 18 March 2022 at 17:29

Pothys - MitrahSoft 15 March 2022 at 14:50

I created a separate ticket for this issue

Andrew Kretzer 14 March 2022 at 23:42

So this fix seems to break our app, though the break starts in 5.3.9.100, not 101? In short, if we have two form fields with the same name and one of them has an empty value, the form post value has always been just the value of the one field. Now, a comma is being appended to the end of that value. Is that proper behavior or a bug?

Previously this would yield:
form.abc = “12345“
but now it yields
form.abc = “12345,“

Zac Spitzer 8 March 2022 at 00:22

Pothys - MitrahSoft 7 March 2022 at 14:30

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 26 March 2020 at 22:19
Updated 18 March 2022 at 17:29
Resolved 7 March 2022 at 13:27