Query.addRow not compatible with ColdFusion
Description
Environment
Activity
Pothys - MitrahSoft 26 July 2022 at 06:41Edited
I've checked this ticket with the lucee latest build 6.0.0.211-SNAPSHOT. Now Query.addRow(), Query.addColumn(), Query.deleteRow(), Query.deleteColumn() returns updated query in lucee. Also, the admin application page shows the extensions correctly.
Zac Spitzer 25 July 2022 at 21:11
Pothys - MitrahSoft 25 July 2022 at 14:57
I've checked this ticket with lucee latest build 6.0.0.210-SNAPSHOT. By this commit, https://github.com/lucee/Lucee/commit/3d373e15eb1b94470904a7ee4f0993256a305261 lucee 6 - Admin Application page shows Can't cast Complex Object Type Query to a number value error
I added a fix to this issue
Pull Request: https://github.com/lucee/Lucee/pull/1721
Stacktrace
lucee.runtime.exp.ExpressionException: Can't cast Complex Object Type Query to a number value
at lucee.runtime.type.QueryImpl.castToDoubleValue(QueryImpl.java:1929)
at lucee.runtime.op.Caster.toDoubleValue(Caster.java:450)
at lucee.runtime.op.Caster.toDouble(Caster.java:329)
at lucee.runtime.op.Caster.castTo(Caster.java:4061)
at lucee.runtime.interpreter.ref.cast.Casting.getValue(Casting.java:61)
at lucee.runtime.interpreter.ref.util.RefUtil.getValue(RefUtil.java:37)
at lucee.runtime.interpreter.ref.func.BIFCall.getValue(BIFCall.java:128)
at lucee.runtime.type.util.MemberUtil.call(MemberUtil.java:139)
at lucee.runtime.type.QueryImpl.call(QueryImpl.java:2038)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1768)
at admin.ext_functions_cfm184$cf$b.udfCall1(/context/admin/ext.functions.cfm:284)
at admin.ext_functions_cfm184$cf$b.udfCall(/context/admin/ext.functions.cfm)
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112)
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:350)
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223)
at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:787)
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:787)
at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1768)
at admin.ext_applications_list_cfm966$cf$8.call(/context/admin/ext.applications.list.cfm:3)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1049)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:941)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:922)
at admin.ext_applications_cfm184$cf.call(/context/admin/ext.applic
ations.cfm:113)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1049)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:941)
Zac Spitzer 22 July 2022 at 14:14
Pothys - MitrahSoft 21 June 2021 at 10:18
I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.8.184-SNAPSHOT also. Query.addRow()
returns number of rows added to query. Since ACF-2018 Query.addRow()
returns updated query. Seems lucee also has same incompatibility with ACF for the member functions Query.addColumn(), deleteRow(), deleteColumn()
.
I added a fix to this ticket
Pull Request: https://github.com/lucee/Lucee/pull/1359
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Adam CameronAdam CameronPriority
NewFix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Details
Details
Assignee
Reporter
Priority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Repro:
records = queryNew("number"); writeDump(records.addRow([["tahi"], ["rua"]])); writeDump(queryAddRow(records, [["toru"], ["wha"]])); writeDump(records);
Note how since CF2018, the
addRow
method has returned the updated query, instead of the number of rows inserted.This is a better return value anyhow, and it'd be great if Lucee maintained compat with CF.