Coldfusion 2021/23 Scope Variable Changes

Hi

As of release 13 of ColdFusion hotfixes for 2021 and 2023, coldFusion will default to searchimplicitscopes=False. The plan AFAIK is to ditch this switch in the future.

This can be overcome in the short term by setting searchimplicitscopes = true.

Where does Lucee stand on this change - Will lucee keep this switch so that old code will run without refactoring?

TIA

Tony Legge

I do not speak on behalf of Lucee but under Lucee: sessions / scope you can change the scope settings.

The AFC issue in question is strictly a bug with AFC.

with Lucee its a configuration switch on searching of scopes

My stance would be, AFC does not matter, as AFC has AFC issues, and as times pass AFC has done very to innovate their product, instead they copy the Lucee community.

Local scope mode Defines how the local scope of a function is invoked when a variable with no scope definition is used.

  • Modern

the local scope is always invoked

  • Classic (CFML Default)

the local scope is only invoked when the key already exists in it

You can also set this in the Application.cfc as follows: copy

this.localMode = "classic"; // or "modern" // or as part of a function declaration function test() localMode="classic" {}
Cascading

Depending on this setting Lucee scans certain scopes to find a variable called from the CFML source. This will only happen when the variable is called without a scope. (Example: #myVar# instead of #variables.myVar#)

  • strict: scans only the variables scope
  • small: scans the scopes variables,url,form
  • standard (CFML Standard): scans the scopes variables,cgi,url,form,cookie

You can also set this in the Application.cfc as follows:

this.scopeCascading = "standard";
Search resultsets When a variable has no scope defined (Example: #myVar# instead of #variables.myVar#), Lucee will also search available resultsets (CFML Standard) or not

< Application.cfc / Code >

1 Like

Thanks for your thoughts Terry… I agree with you!

1 Like