dswitzer
08/07/2023, 3:57 PMqueryFilter() functionality it's altering the datatype of my columns in subtle ways that affects the use of columnData().
For example:
<cfscript>
ids = queryNew("id", "varchar", [["0001"], ["2"], ["003"], ["0000004"], ["5"]]);
dump(ids.columnData("id"));
dump(ids.filter((row) => true).columnData("id"));
dump(queryFilter(ids, (row) => true).columnData("id"));
</cfscript>
In this case it's changing the string data to numeric values. So instead of getting back ['0001', '2', '003', '0000004', '5'] I get [1, 2, 3, 4, 5]. You can see an example of it on TryCF. It behaves this way in Lucee 5 and 6.
Is this related to LDEV-3445?Adam Cameron
dump(ids.map((row)=>row).columnData("id"))Adam Cameron
Adam Cameron
columnData is a red herring here. Well it's demonstrating a symptom, but it's not part of the problem.dswitzer
08/07/2023, 5:27 PMvalueList(ids.id).listToArray() but that's certainly not ideal. However, eh valueList() works correctly (but valueArray() does not).Adam Cameron
valueList and valueArray are clearly not doing the same thing under there hood, with just the final return value being changed.zackster
08/07/2023, 6:03 PMzackster
08/07/2023, 6:05 PMzackster
08/07/2023, 6:06 PMzackster
08/07/2023, 6:14 PMzackster
08/07/2023, 6:18 PMcfvonner
08/07/2023, 6:18 PMvalueList and valueArray are deprecated). While I appreciate that QueryColumnData is the recommended approach for Lucee (which returns an array like valueArray), the valueList and valueArray are not deprecated in ACF and will need to be kept in perpetuity for compatibility. As such, they should also work correctly, and match the functionality of ACF.zackster
08/07/2023, 6:19 PMzackster
08/07/2023, 6:20 PMcfvonner
08/07/2023, 6:21 PMQueryColumnData is the recommended approach. I'm asking why the previous functions are "deprecated" - which in common parlance would indicate that they are no longer supported and might be removed in a future version. So again, what does "deprecated" mean in the context of Lucee?zackster
08/07/2023, 6:23 PMzackster
08/07/2023, 6:23 PMzackster
08/07/2023, 6:26 PMzackster
08/07/2023, 6:27 PMdswitzer
08/07/2023, 7:48 PMQueryImpl() call needs a list of the datatypes passed in.
I may have some cycles later in the week and if so I'll try to put out a patch for this.cfvonner
08/08/2023, 3:43 PM