tracker issue : CF-4018933

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

Member functions continue to be broken in edge cases

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Adam Tuttle / Adam Tuttle (Adam Tuttle)

Created: 07/09/2015

Components: Language

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: ALL / Platforms All

Vote Count: 3

Listed in the version 2016.0.0.297996 Issues Fixed doc
Verification notes: verified_fixed on August 24, 2019 using build 2016.0.01.298513
Given a query object:

tmp = queryExecute("select personId from Person limit 10");

you would expect to be able to run this code using member functions on the result:

people = valueList( tmp.personId ).listToArray();

But CF chokes on this during template compilation, throwing a very unhelpful error message:

> Invalid construct: Either argument or name is missing.
> When using named parameters to a function, each parameter must have a name.

We can see that the result of the call to valueList() is a string:

<cfdump var="#getMetaData( valueList(tmp.personId) ).getName()#" label="getMetaData( valueList ).getName()" />
==> java.lang.String

So it appears this is yet another member-function parsing issue.

At first this may seem like a duplicate of either of these issues:

But as one is for the append function specifically, and the other is for struct and array literals, it's possible that their fixes may not also fix this problem, so I decided it was best to log this separately.

Anywhere you're wrapping a java type in a coldfusion type (e.g. coldfusion.runtime.array), you should make sure the appropriate member functions work, and it's a shame that we seem to have to ask for each instance to be fixed as we find it, rather than you doing due diligence and finding all of the places that could be affected and fixing them.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4018933

External Customer Info:
External Company:  
External Customer Name: Adam
External Customer Email:  
External Test Config: CF11u4 (we refuse to use u5 as it breaks more than it fixes)

OSX 10.10.4



We need thoughtfully and thoroughly implemented consistency with these things.
Vote by External U.
6757 | July 09, 2015 02:30:04 PM GMT
This certainly doesn't pass the "least surprise" principle test: if a function produces a string as a result, you should be able to chain string member function calls onto it.
Vote by External U.
6758 | July 09, 2015 02:34:16 PM GMT
+1 ......................
Vote by External U.
6759 | September 21, 2015 09:25:00 AM GMT
member functions are now supported on ValueList and QuotedValueList
Comment by Milan C.
6753 | September 25, 2015 01:17:28 AM GMT
I hasten to point out that this bug, in spirit, is very likely _not_ "fixed" as the current status would indicate. You've said that string member functions are now supported on valueList and quotedValueList, but that does not mean that this bug -- "member functions continue to be broken in edge cases" -- is resolved. It only means you've managed to whack this mole. I suggest that you should go hunting for more. There is a finite list of functions, and even documentation to list them all for you. You should be able to determine the data type of the response of each of them pretty easily, then it's just a matter of testing the appropriate member functions on those types. I'd do it for you, but, well, I don't get paid for that sort of thing and you do.
Comment by External U.
6754 | September 25, 2015 07:12:11 AM GMT
This is the para my attention was drawn to when reading the current status of this ticket: "it's a shame that we seem to have to ask for each instance to be fixed as we find it, rather than you doing due diligence and finding all of the places that could be affected and fixing them." So - Milan - can you pls confirm how thorough you were in dealing with this issue? And that you found *no other anomalies at all* in any other member function implementations, and it was merely a lucky coincidence that AdamT managed to nail the only two which had problems? Because this does seem a little "coincidental".
Comment by External U.
6755 | September 25, 2015 07:22:11 AM GMT
Our team try to actively find any possible language bugs, so that is a continuous process. In this bug, valueList was reported as an example. We found that valueList had a special handling from our parser so it was breaking. As part of our fix we found that same check was done for QuotedValueList too and we fixed that too. There was no special handling for any other function from our parser. After fixing these two, I marked this bug as fixed. So yes, in context of the bug, we did a thorough search for similar problems.
Comment by Milan C.
6756 | September 28, 2015 05:10:02 AM GMT
Hi Adobe, I've verified this is fixed in CF2016 Update 1 (build 2016.0.01.298513). Thanks!, -Aaron
Comment by Aaron N.
31171 | August 24, 2019 06:48:15 AM GMT