tracker issue : CF-4204053

select a category, or use search below
(searches all categories and all time range)

Listappend does not return the list unchanged when you add an empty string

| View in Tracker

Status/Resolution/Reason: To Fix/Fixed/HaveNewInfo

Reporter/Name(from Bugbase): Oliver N. / ()

Created: 02/27/2019

Components: Language, Functions

Versions: 2016,2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: Updater 7, Updater 8, Updater 9 / 314086

Priority/Frequency: Normal / All users will encounter

Locale/System: ALL / Win 2012 Server x64

Vote Count: 0

Problem Description:

Listappend returns

A copy of the list_,_ with value appended. If value = "", returns a copy of the list, unchanged.

Listappend does not return the list unchanged when you add an empty string! It returns a "," appended

Steps to Reproduce:

<cfset list = "test">
<cfset list = listappend(list, "")>

Actual Result:
Expected Result:
Any Workarounds:
Do not append empty values to listappend



Hi Oliver, # We need to update the docs which states "If value = "", returns a copy of the list, unchanged." # If we return copy of list unchanged when empty value is appended, then it might break other list function where includeEmptyFields parameter is used. Example : ListLen(),ListGetAt().   Thanks, Mukesh
Comment by Mukesh K.
30648 | April 23, 2019 08:15:42 AM GMT