tracker issue : CF-4202595

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

StructFindKey path is returned as associative array rather than a period delimited list

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/NotABug

Reporter/Name(from Bugbase): Justin Treher / ()

Created: 05/23/2018

Components: Language, Functions

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal /

Locale/System: / Windows 10

Vote Count: 0

Problem Description:
StructFindKey() appears to get confused with strings that can be cast to double. For instance, this one has an "R" towards the end. This has the appearance of the old serialization issues with scientific notation serialization issues where strings that _could_ be converted to double would be. You can change the key to be any other numeric value and it happens as well.

CF10, CF11, Lucee all have a dot delimited path returned. CF2016/2018 do not.

https://trycf.com/gist/833bc52fa0e0230a23a98a53707504e6/acf2016?theme=monokai

Steps to Reproduce:

<cfscript>
xyz = {};
xyz["959840420R24"] = {};
xyz["959840420R24"]["102"] = 1;

writeDump(structFindKey(xyz, "102", "all"));
    
</cfscript>

Actual Result:
["959840420R24"]["102"] <- Associative Array
Expected Result:
.959840420R24.102
Any Workarounds:
....

Attachments:

Comments:

This change was made as a part of fix for the bug , [https://tracker.adobe.com/#/view/CF-4087863.] StructFindKey will return dotted notation , if the key is a valid identifier . Otherwise will return  Associative Array. "All identifiers must begin with a letter, an underscore, or a Unicode currency character. Any other symbol, such as a number, is not valid. " Hence this is not a bug.
Comment by Suchika S.
29835 | October 24, 2018 09:48:37 AM GMT