I have moved well over 100 websites and applications from Adobe ColdFusion to Lucee servers over the past few months. While 95% of the code is cross-compatible and works right away, I have run into a few things that I thought I should share. This is not meant to be a comprehensive list of incompatibilities between Adobe CF and Lucee. You can get a list of differences from the Lucee docs. This is really just a bunch if tips and solutions for common issues. I will probably write separate articles about some of them.
First, a bit of a disclaimer… I am not proposing the solutions below as the BEST solution to the issue. In most cases, I am not in a position to re-engineer the code. My job has been to get websites that are running old ColdFusion code over to Lucee in the most efficient way. If I were able to rebuild these sites or applications, I would not have taken the same approach in many cases.
Hindsight is always 20/20. We should never have invested in this tag, or really any of Adobe’s Ajax-based tags. For some reason, back in the 00s, we loved CFGRID and used it all over the place. Rather than rewrite every implementation across hundreds of files to use a different technology, I decided to write a CFGRID alternative tag and install it on Lucee. It still required minor adjustments to existing CFGRID code, but it probably saved weeks of programming time. CFGRID-Lucee is available here on GitHub: https://github.com/spraguey/cfgrid-lucee
CFWINDOW, CFDIV, AND CFTOOLTIP
Luckily, I did not encounter many of these. I had to manually update the code for these to use an independent (of Lucee) solution. Most of the sites I work on have jQuery already on them, so here are the alternatives I used.
- CFWINDOW – jQuery UI Dialog
- CFDIV – There isn’t really much use in this tag. They can be changed to simple DIV tags and then you can use jQuery or any other library for working with the DOM.
- CFTOOLTIP – If you already have jQuery UI loaded, then the UI Tooltip is the way to go. If you don’t want the expense of loading UI, then Tooltipster is a nice solution.
Adobe built a lot of custom functionality into ColdFusion for PDF manipulation. This is not in Lucee by default, but MitrahSoft wrote a nice alternative CFPDFFORM tag for Lucee.
You may run into some font issues if your source PDF has Adobe-licensed fonts in it – such as Helvetica. If you do, you will need to open up the source document in Acrobat DC and change those fonts to an OpenType font. Otherwise, you will get errors.
CFSELECT with Bind attribute
CFSELECT does work in Lucee, but the bind attribute is not supported. There is no easy solution for this, so I had to convert these to the way it was done prior to Adobe introducing bind. I used regular HTML and CFML (CFQUERY/CFOUTPUT) for simple list population, and Ajax calls to return dynamically populated select boxes. Paul Underwood has a good example of the Ajax method.
CFINPUT with an ID attribute
- Sublime Text > Find > Find in Files…
- Find: (<(?:cfinput|cfselect|cfform)(?![^>]+\bid\s*=)[^>]*?(?:\bname\s*=\s*[“‘]?((?:[^\t\n\f \/>”‘=#]+|#[^#]+#)+)[“‘]?\s*))([^>]*?>)
- Where: Specify your folder(s). For example: c:\webspace,*.cfm,*.cfc
- Replace: $1 id=”$2″ $3This will go through all of your files and add the id to any cfinputs. The beauty of this replace is that it will only add the ID if there isn’t currently an ID on the tag.
CFINPUT Validation Errors
There were two validation types that caused problems for us.
- cfinput validateAt=”onServer,onSubmit”
Just remove these. Lucee handles the validation correctly and they are not necessary. I used Sublime Text as described above, and replaced them all with an empty string.
- cfinput type=”submit” validate=”submitonce”
This search type does not exist in Lucee. These can be changed to type=”simple”, which doesn’t have much impact on the results.
This is not in Lucee. Hopefully you didn’t use this much, because there is no simple solution here. These need to be re-coded using CFFILE and HTML upload fields.
File size uploads
In Adobe CF, the maximum uploadable file size can be specified in the ColdFusion Administrator. This is not the case in Lucee. If you are on a Windows server, Lucee uses the IIS upload size restrictions. I wrote an article about adjusting this in IIS7. In newer versions of IIS, it may also be necessary to do this at the site level. This article was the best summary for IIS 7.5+.
CFHTTP Get and CFHTTPPARAM
If you are doing a CFHTTP get operation, you can’t pass the URL variables in as CFHTTPPARAMs.
Instead of this…
<cfhttp method="get" url="myfile.cfm>
<cfhttpparam name="myvar" value="myvalue" />
<cfhttp method="get" url="myfile.cfm?myvar=#myvalue#" ></cfhttp>
[EDIT based on comment below. The proper way is:]
<cfhttp method="get" url="myfile.cfm>
<cfhttpparam name="myvar" value="myvalue" type="URL" />
CFHTTP and Basic Authentication over SSL
With cfhttp calls that use SSL and Basic authentication, you cannot pass the username and password in the attributes of the <cfhttp> tag. They need to be passed as headers.
<cfhttp url="https://what.ever.com" username="myusername" password="123">
should be converted to
<cfhttpparam type="header" name="Authorization" value="Basic #ToBase64( 'myusername:1234' )#" />
If you use this with richtext=”true”, you are out of luck. You’ll need to use a library for WYSIWYG editing. If you used it just as a simple form element, then you have two choices. You could go through and update them all to simple <textarea>. Keep in mind, thought, that if you had variables in any of the attributes then these have to be inside of <cfoutput> tags. An alternative is to use this replacement tag for CFTEXTAREA on the server side, which handles all that logic for you. No change to your code is needed in this case.
URL/Form Values as an Array, not a List
This one is hard to explain without an example.
In Adobe CF, url.id would come through as 1,2,3. In Lucee, it comes through as an ARRAY of values that you need to loop through to get the results. <cfloop list=”#url.id#”> becomes <cfloop array=”#url.id#”>
You might ask… why would you ever do this anyway? Well, jQuery UI sortables will come through this way when submitted via Ajax.
[EDIT: My example is a poor one. It should be as follows. Sortables adds the  to the variables and that triggers the issue. The original example above actually works fine in Lucee.]
ODBC Text Datasources
The drivers needed for the JDBC-ODBC bridge are not included in Java 8. If you need to use the bridge, you’ll have to extract them from a Java 7 install and put them in your Java 8 that is used for Lucee. I recently wrote an article that covers this.
That seems like a lot of stuff! Hopefully this does not scare you away from switching over to Lucee. It really is a great engine and runs MUCH faster and more stable than Adobe CF in my experience.