triggerDataMember / invokeImplicitAccessor issue?


#1

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


#2

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.


#3

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.


#4

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.


#5

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).


#6

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.