FIX - Cartweaver on Lucee - ArrayToList Error

70 views
Skip to first unread message

Daniel Jansen

unread,
Apr 14, 2015, 1:11:54 PM4/14/15
to lu...@googlegroups.com
Just a quick tip for anyone who wants to run Cartweaver on Lucee.

(I'm currently running Lucee 4.5.1.003 final and Cartweaver 4.03.01)

You need to add some code so that Cartweaver detects you are running Lucee so that Cartweaver uses the correct List functions.

/site/cw4/admin/cwadminapp/func/cw-func-admin.cfm : Line 64

Looks like this:

 <!--- railo handles this function differently --->
 
<cfswitch expression="#server.coldfusion.productName#">
 
<cfcase value="railo">
 
<cfset returnList = arguments.query_object.getColumnlist(false)>
 
</cfcase>
 
<cfdefaultcase>
 
<cfset returnlist = ArrayToList(Arguments.query_object.getMetadata().getColumnLabels())>
 
</cfdefaultcase>
 
</cfswitch>

Change to this:

 <!--- railo handles this function differently --->
 
<cfswitch expression="#server.coldfusion.productName#">
 
<cfset returnList = arguments.query_object.getColumnlist(false)>
 
</cfcase>
 
<cfcase value="Lucee">
 
<cfset returnList = arguments.query_object.getColumnlist(false)>
 
</cfcase>

 
<cfdefaultcase>
 
<cfset returnlist = ArrayToList(Arguments.query_object.getMetadata().getColumnLabels())>
 
</cfdefaultcase>
 
</cfswitch>

Regards,

Daniel Jansen

Adam Cameron

unread,
Apr 14, 2015, 5:53:06 PM4/14/15
to lu...@googlegroups.com


On Tuesday, 14 April 2015 18:11:54 UTC+1, Daniel Jansen wrote:
Just a quick tip for anyone who wants to run Cartweaver on Lucee.

A more long-term fix might be to use getMetadata() (the function, not the method) on the recordset and get the columns that way? I've not checked, but presume this'd yield the same results on all platforms, given it's a native CFML function, not simply leveraging the undocumented behaviour of the recordset class's methods.

-- 
Adam 
Reply all
Reply to author
Forward
0 new messages