Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Graham B. / ()
Created: 02/11/2019
Versions: 2016,2018
Failure Type: Data Loss
Found In Build/Fixed In Build: ColdFusion: 2016,0,07,311392-Evaluation / 314559
Priority/Frequency: Normal / All users will encounter
Locale/System: ALL / Platforms All
Vote Count: 1
Problem Description:
CFLOOP, when iterating over an array, will *skip* array values that are undefined (such as when a query returns a null value, or when a left join has no joined value, among others).
Steps to Reproduce:
Create an array with one or more *undefined array elements*. Loop through the array using `<CFLOOP array="">`.
Actual Result:
Unbelievably, CFLOOP just jumps right past the undefined array elements. For example, an array of length 8 will not execute 8 times.
Expected Result:
CFLOOP will execute the same number of times as the length of the array. Undefined array elements will be supplied to the index so that a query returning multiple results doesn't have arrays of different lengths for different rows.
Any Workarounds:
Use other means to loop, but seriously why even have CFLOOP support arrays if it's unusably broken.
Attachments:
Comments: