triggerDataMember / invokeImplicitAccessor issue?

I think I may be hitting an old bug, but am unsure.

Am using FW/1 and have passed a bean to a save function expecting a struct, which I thought would cause the bean to be flattened, and its properties used to pass its values to the necessary function body. Instead, I get

Enable [trigger data member] in administrator to also invoke getters and setters

…except that I have. It’s enabled in the admin (both web and server) plus I’ve tried overriding it by setting the respective app vars in Application.cfc. Nothing seems to work.

Anyone else seen this recently? The bug referenced above wasn’t reproducible…but mine definitely is.

Lucee: 5.2.6.60
FW/1: 4.2.0

Are you saving directly in the bean by calling on itself like “this.propertyName” as opposed to this.getPropertyName()?

If that’s the case, I am able to reproduce. Oddly enough, if you pass “this.getPropertyName” (note the missing parentheses), then it works. This definitely looks to be a bug. Edit: omitting the parentheses results in the value being the method signature so I don’t think that’s actually related or a problem.

Please share some code. I think your base assumption is wrong. Passing a CFC into an argument that is typed as a struct will not, to my knowledge, convert your CFC to a struct. Generally speaking, argument types never convert your values or change them at all. They only confirm that the incoming value satisfies that data type. And a CFC is considered a struct, or at least, isStruct( myCFCInstance ) will return true.

Before I supply code (because I’m starting to suspect I didn’t recall this functionality accurately) I’m basing my claim on this blog post from Adam Cameron, which (if I’m reading correctly) boils down to:

  1. Create a CFC.
  2. Give it some properties.
  3. The properties should be accessible as if it were a struct and through its generated getters/setters. An either-or situation.

which comes from reading his bullet, here:

setting invokeImplicitAccessor=true in Application.cfc means that if you have accessors for the property (well: you don’t even need the properties specified, in reality) then they will be called implicitly if you access the property.

Perhaps my forcing the type in the input is stripping the CFC of its ability to call its accessors via its properties?

EDIT : Negative. Removed the type from the input parameter, same error as before. Can call the bean’s getter/setter, but trying to access its property yields enable [trigger data member] in administrator to also invoke getters and setters.

I’m following up with the Framework-One mailing list - this may be related to an issue with the beanFactory’s invocation of a CFC, as opposed to invoking the CFC by hand (which i was able to get working without issue on that Lucee build indicated above).

FWIW, this seems to work fine on Adobe CF 2016 with invokeImplicitAccessor = true, so I don’t think this is a FW/1 issue, I think this is a Lucee bug.

2 Likes

Hi,
I got the same issue with this code at getToken() mehh

component implements=“TokenValidatorInterface” extends=“AbstractCryptor” accessors=“false” {
property type=“object” name=“validator”;

public TokenValidatorInterface function init(string keyFilePath=“”) {
variables.encryptionKey = “”;
if (arguments.keyFilePath != “”) {
loadKeys(arguments.keyFilePath);
}
variables.validator = createObject(“java”, “corp.app.helios.sso.HeliosTokenValidator”).init(variables.encryptionKey);
return this;
}

public void function setEncryptionKey(required string newKey) {
super.setEncryptionKey(newKey);
variables.validator = createObject(“java”, “corp.app.helios.sso.HeliosTokenValidator”).init(variables.encryptionKey);
}

public string function getAuthenticatedUser(required string encryptedData) {
return this.validator.getAuthenticatedUser(encryptedData);
}

public string function getToken(required string userName, required numeric durationInSeconds) {
return this.validator.getToken(userName,durationInSeconds);
}

}

@AlexD1979, here’s the bug if you want to keep tabs on it: [LDEV-1789] - Lucee