Regression: In Lucee 5.3.3, component Property function does not recognize variables defined at the top of that Component

Description

Issue: Component Property function does not recognize variables defined at the top of that Component

Tested working Lucee versions: 4.5 through to 5.3.2.77

Tested failing on Lucee version: 5.3.3.62

Description:

I have an application that has been working without issue under Lucee versions 4.5 through to 5.3.2.77
When tested with the current release of Lucee, 5.3.3.62 it fails.

The failing component defines variable in the "this" scope. Then when the property function references them it fails with the error:

"Component [test1] has no accessible Member with name [TEST]"

Lucee up to 5.3.2.77 is able to use "this" & "variables" scoped variables in property statements.
Lucee 5.3.3.62 is not able to use "this", "variables", "static" scoped variables in property statements.

Below is a cfm/cfc test pair to demonstrate the error:

— test1.cfm —
<cfdump var="#server#" />
<cfflush>

<cfscript>
testcfc = new test1();
testdata = testcfc.testfunc();
</cfscript>

<cfdump var="#testdata#" />

-----------------

— test1.cfc —
component output="false" accessors="true" persistent="true" entityname="entityTest1"
{
this.test.unverified = 0;
this.test.verified = 1;
this.foo = 'this.test1var';
variables.bar = 'variable testvar';

property name="testStatus" type="numeric" sqltype="tinyint" length="1" default="#this.test.verified#";

public any function testfunc()
{
return "#this.test.verified# - #this.foo# - #variables.bar#" ;
}
}

-----------------

Environment

Lucee 5.3.3.62 on Linux, installed via "run" package

Activity

Show:
Pothys - MitrahSoft
January 22, 2020, 1:36 PM

I've checked and added a test case for this ticket and confirmed the issue happened on Lucee affected & the Latest version(5.3.5.63 SNAPSHOT) also. It works fine in 5.3.2.77 Snapshot and ACF.

Pull Request: https://github.com/lucee/Lucee/pull/831

Michael Offner
March 17, 2020, 10:05 AM
Edited

the last version that worked was 5.3.3.18-SNAPSHOT and the first that fails is 5.3.3.19-SNAPSHOT

Michael Offner
March 17, 2020, 10:13 AM

stacktrace:

lucee.runtime.exp.ExpressionException: Component [test1] has no accessible Member with name [TEST]
at lucee.runtime.ComponentImpl.get(ComponentImpl.java:1767)
at lucee.runtime.util.VariableUtilImpl.get(VariableUtilImpl.java:267)
at lucee.runtime.PageContextImpl.get(PageContextImpl.java:1499)
at ldev2645.test1_cfc$cf.initComponent(/LDEV2645/test1.cfc:9)
at ldev2645.test1_cfc$cf.newInstance(/LDEV2645/test1.cfc:1)
at lucee.runtime.component.ComponentLoader.initComponent(ComponentLoader.java:548)
at lucee.runtime.component.ComponentLoader._loadComponent(ComponentLoader.java:487)
at lucee.runtime.component.ComponentLoader.load(ComponentLoader.java:410)
at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:222)
at lucee.runtime.component.ComponentLoader._search(ComponentLoader.java:117)
at lucee.runtime.component.ComponentLoader.searchComponent(ComponentLoader.java:79)
at lucee.runtime.PageContextImpl.loadComponent(PageContextImpl.java:3148)
at lucee.runtime.functions.other.CreateObject.doComponent(CreateObject.java:148)
at lucee.runtime.functions.other._CreateComponent.call(_CreateComponent.java:42)
at ldev2645.index_cfm$cf.call(/LDEV2645/index.cfm:2)

 

Michael Offner
March 17, 2020, 10:42 AM

this is the commit causing the issue

Fixed

Assignee

Michael Offner

Reporter

Paul

Priority

Critical

Fix versions

Sprint

5.3.8 Sprint 3

Affects versions

Configure