Lucee 7 and Coldbox

For anyone testing their Coldbox app on Lucee 7, you will likely encounter an invalid syntax, variables are not supported error on boot. This is due to this breaking change in Lucee 7.

Some parts of the Coldbox framework have code like this:
param name="globalModuleSettings[ mConfig.modelNamespace ]" default="#structNew()#"

A temp workaround is to disable this Lucee 7 change. You can do so in your Application.cfc like this: this.security.limitEvaluation=false or by using an environment variable.

There is some discussion about this in the Ortus Coldbox Slack channel here.

1 Like

Thanks for this information!
But I can’t figure out what that flag does.

I understand that the limitation is only in setting the variable name.
That is, I cannot set it dynamically.

As if I did
<cfset "myip_#cgi.remote_add#" = "bla bla">

Correct?

Thanks!

ticket raised

https://luceeserver.atlassian.net/browse/LDEV-5663

TBH using param in this fashion ain’t great, especially in framework code, as it’s slower and it’s doing dynamic evaluation, cfparam has history

I did a couple of runs, using structKeyExists is anything from 30 - 100% faster with 6.2, obvs can’t do this with 7.0 on trycf

cffiddle with ACF also doesn’t seem to like this code either? trycf is throwing a different error (Complex object types cannot be converted to simple values.)

<cfscript>
function testParam(){
        var globalModuleSettings = {};
        var mConfig.modelNamespace = "test";
        
       param name="globalModuleSettings[mConfig.modelNamespace]" default="test";
        writeDump(globalModuleSettings);
    }
    testParam();
    </cfscript>