replaceList() doesn't handle optional args the same as Adobe CF

Description

ACF allows the "includeEmptyFields" paramter to the replaceList() function to be in the 4th OR 5th OR 6th position.

replaceList(String, list1, list2 [, includeEmptyFields]) replaceList(String, list1, list2, delimiter [, includeEmptyFields]) replaceList(String, list1, list2, delimiterList1, delimiterList2 [, includeEmptyFields])

https://cfdocs.org/replacelist

But Lucee behaves differently. See these examples:

// Only works in ACF writeDump( replacelist( "{name}", "{,}", ",", true) ); // Works in both writeDump( replacelist( "{name}", "{,}", ",", ",", ",", true) );

Activity

Pothys - MitrahSoft 30 November 2021 at 08:25

I've checked this ticket with the lucee latest build 6.0.0.141-SNAPSHOT. Now replaceList()/replaceListNocase() works fine and same as ACF.

Michael Offner 29 November 2021 at 14:22

i added the change, please give the new build another try.

Pothys - MitrahSoft 23 November 2021 at 11:26

I checked this ticket with the lucee latest build 6.0.0.132-SNAPSHOT. Using replaceList() with multicharcter value as delimer have a incompatibility with ACF. https://trycf.com/gist/600b4de1ca4f8cf15045d1b4a9af3216/acf2021?theme=monokai

I added a fix to this issue and updated a testcase
Pull Request: https://github.com/lucee/Lucee/pull/1472

Michael Offner 19 November 2021 at 15:39

please give the new build another try

Fixed

Details

Assignee

Reporter

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

Fix versions

Priority

Created 2 March 2020 at 06:21
Updated 18 September 2024 at 09:41
Resolved 30 November 2021 at 08:25