Hi group,
I've finally managed to work this one out.
The problem seems to be coming from this line in the CMS > Packages > Rules
> ruleHandpicked.cfc.
<cfproperty ftSeq="2" ftFieldSet="Selected Objects"
*name="aObjects"*type="array"
ftJoin="dmEvent,dmFacts,dmFlash,dmFile,dmImage,dmInclude,dmLink,dmNews,dmHTML"
arrayProps="webskin:string" ftLabel="Select Objects" />
When the BaseGateway is doing lookups through joining tables it now seems
to rely on there being a _aObjectIDs suffix on the table name.
That's a change from our 5.2.3 copy because FarCry didn't used to care what
the property was called (or is this maybe a bug in core if it's not
actually meant to care?)
The steps I went through to fix this are:-
1) Remove the "aObjects" property above and replace it with one called
"aObjectIDs". Deploy that through the webtop. Syntax I've got for this is:-
<cfproperty ftSeq="2" ftFieldSet="Selected Objects" name="aObjectIDs"
type="array" arrayProps="webskin:string" ftLabel="Select Objects"
ftJoin="dmEvent,dmFacts,dmFlash,dmFile,dmImage,dmInclude,dmLink,dmNews,dmHTML"
/>
The methods in that rule ftEditAObjects and ftValidateAObjects also need to
be renamed to ftEditAObject*ID*s and ftValidateAObject*ID*s or the formtool
won't load into the page.
In my case, as I'm extending the Plugin's Handpicked Rule anyway, I've
placed new methods in my project and just passed the request up to the
plugin's original methods.
<cffunction name="ftEditAObjectIDs" access="public" output="false"
returntype="string" hint="This is going to called from ft:object and will
always be passed 'typename,stobj,stMetadata,fieldname'.">
<cfargument name="typename" required="true" type="string" hint="The
name of the type that this field is part of.">
<cfargument name="stObject" required="true" type="struct" hint="The
object of the record that this field is part of.">
<cfargument name="stMetadata" required="true" type="struct"
hint="This is the metadata that is either setup as part of the type.cfc or
overridden when calling ft:object by using the stMetadata argument.">
<cfargument name="fieldname" required="true" type="string"
hint="This is the name that will be used for the form field. It includes
the prefix that will be used by ft:processform.">
<cfargument name="stPackage" required="true" type="struct"
hint="Contains the metadata for the all fields for the current typename.">
<cfreturn ftEditAObjects(
typename = arguments.typename,
stObject = arguments.stObject,
stMetadata = arguments.stMetadata,
fieldname = arguments.fieldname,
stPackage = arguments.stPackage
) />
</cffunction>
2) I then run a migration script that copies the records from the old
aObjects table to the new aObjectIDs one. Happy to drop that in here as
well if people need.
Handpicked rule, and our CaseStudy that had the same aObject name, are now
fixed!
-----
So I guess in terms of a fix for future releases you'd be looking to either
changing that property name on the CMS rule or the BaseGateway needs
something in there to look for a suffix of the properties name instead.
Hope that helps someone else & I'll drop reference to this in the bug
ticket as well.
Cheers,
James
--
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: [email protected]
To unsubscribe, email: [email protected]
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry