Posts

Showing posts with the label Lucee

Lucee vs Adobe ColdFusion columnList vs getColumnList vs getmetadata

I have a general section which dynamically displays reports, which are preconfigured in a certain way.  There are some totals and data rows which are not part of the metrics so net result is I had some CF code looking at the column lists and displaying appropriately.  Turns out there are very different results between Lucee and Adobe Coldfusion, for this example, it's important to create a sample table like so:  CREATE TABLE testtable( [Col1] [varchar](50) NULL, [ACol2] [varchar](50) NULL ) so that ACol2 is actually alphabetically before Col1.  Then run this <cfquery datasource="aTestDSN" name="qry"> select * from testtable </cfquery> <cfset columns = ""> <cfloop array="#getmetadata(qry)#" item="aryItem"> <cfset columns = listappend(columns, aryItem.Name)> </cfloop> <table> <tr><td>getmetadata</td><td><cfoutput>#columns#</cfoutput></td></tr...

Lucee 4.5.2 cfhttp inconsistent timeout response with Adobe Coldfusion

Trying to catch a timeout is alwas a problem, particularly on those jumpy sites that are normally ok, but can be offline for an hour or 2 when the owners is asleep! There is a bug here https://luceeserver.atlassian.net/browse/LDEV-80 but it is not quite the same and I do get a correct response if in the example below sleep(4000) was replaced by a=1/0; Suppose a file like so: <cfif structkeyexists(url, "test")>     <cfscript>sleep(4000);</cfscript> <cfelse> <cftry>     <cfhttp timeout="2" url="http://#cgi.http_host##cgi.script_name#?test" throwonerror="true" result="x" />     <cfcatch type="any">        <cfdump var="#x#" />         <cfdump var="#cfcatch#" />     </cfcatch> </cftry> </cfif> Lucee 4.5.2 produces Struct errordetail string while the cfcatch adds in this s...

Lucee 4.5.2 cfparam null value error with full null support

With cfparam and the full null support (non default behaviour) there is a dodgy impact: Suppose qryDB has a null valued column, and you set a variable to that null value <cfparam name="myVar" default="#qryDB.nullValueColumn#"> This throws an error, same as would happen in this instance; <cfparam name="myVar"> Though the later appears to be inconsistently present in Adobe ColdFusion also; http://blog.adamcameron.me/2013/04/coldfusion-bugs-id-like-to-see-dealt.html

Lucee 4.5.2 cfpdfparam difference with Adobe ColdFusion

Suppose the following on Lucee 4.5.2: <cfset x = 1> <cfdocument format="pdf" pagetype="A4" name="myVar#x#"> <cfdocumentsection> Hi there </cfdocumentsection> </cfdocument> <cfpdf action="merge" destination="RAM:///myPDF.pdf" overwrite="yes">     <cfpdfparam source="#evaluate("myVar#x#")#" /> </cfpdf> <cfcontent file="RAM:///myPDF.pdf" type="application/pdf"> then to check it also runs on Adobe Cf; you'd actually end up with: "ByteArray objects cannot be converted to strings."   The original code for Adobe CF ran with the paramater like so:  <cfpdfparam source="myVar#x#" /> Both sets of documentation list source defined as follows: "Source PDF file to merge. You can specify a PDF variable, a cfdocument variable, or the pathname to a file." This would indicate it is just...