tracker issue : CF-4200508

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

toList() Does Not Work on getColumnList()

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Eric Fxd / Eric Fxd ()

Created: 01/08/2018

Components: Language, Member Functions

Versions: 2016,2018

Failure Type: Others

Found In Build/Fixed In Build: ColdFusion 2016 Update 5 /

Priority/Frequency: Normal /

Locale/System: / Win 2016

Vote Count: 0

Problem Description: Member function toList() doesn't work on the getColumnList() function of a query object.

Steps to Reproduce:
1) Create a query
{code:java}
<cfscript>
news = queryNew("id,title", "integer,varchar");
queryAddRow(news);
querySetCell(news, "id", "1");
querySetCell(news, "title", "Dewey defeats Truman");
queryAddRow(news);
querySetCell(news, "id", "2");
querySetCell(news, "title", "Men walk on Moon");
</cfscript>
{code}

2) Dump the column list to see it's an array
{code:java}
<cfscript>
WriteDump(news.getColumnList());
</cfscript>
{code}

3) Get an error when using the toList() member function ("The toList method was not found")
{code:java}
<cfscript>
WriteOutput(news.getColumnList().toList());
</cfscript>
{code}


Actual Result: Error in step 3 above

Expected Result: Step 3 above should produce the same result as
{code:java}
<cfscript>
WriteOutput(ArrayToList(news.getColumnList()));
</cfscript>
{code}


Any Workarounds: None

Attachments:

Comments:

getColumnList() returns a string [] and not an array object.We have a hack for converting String[] to array for the headless version. We have added similar hack for member function if it is for the function parameter but not for the calling object. The calling object has to be an array for the member function resolution. Member function follows a stricter check and thus this is not supported. Hence,we are closing this bug.
Comment by Suchika S.
136 | March 15, 2018 12:38:34 PM GMT