|Stopping Cascade Approvals||James Buckingham||2/24/12 7:46 AM|
I've got a Content Type of "Course" and this has a relationship with another of type "Fees".
In the Course I've added an onApprove() event which I'm using to update some of the data in the related Fees however I've noticed a strange bug that when it is approved any associated Fees that are currently in draft are also being switched to approved as well.
No matter what I code into either the Course or Fee nothing seems to stop this action. Even an onStatusChange() in the Fees and trying to revert the change makes no difference.
I did notice on this wiki page that there is a thing called "Default Hook Cascade".
Is this what's happening here and is there anyway I can turn this off?
|Re: Stopping Cascade Approvals||Sean Coyne||2/24/12 7:49 AM|
I would look into the "statustodraft", "statustopending", and "statustoapproved" functions found in versions.cfc and types.cfc. You should be able to override these in your content type.
These may govern the cascade, but I have never tried to stop the cascade, I usually want my child objects to be promoted to approved when the parent object is approved.
Sorry I can't be of greater help.
|Re: Stopping Cascade Approvals||James Buckingham||2/24/12 8:20 AM|
Thanks for the quick reply Sean. Appreciated it :-).
The situation I'm trying to avoid is Marketing taking a Couse into draft, making changes and then approving. In the meantime Student Finance are preparing all the Fees in the background but aren't ready to go live yet.
The Courses switching on all the Fees would be an unwanted side-effect.
I'll have a look at those methods though thanks :-). The others I've used so far have allowed me to apply the change but the moment I exit FarCry applies the approval anyway!
|Re: [farcry-dev] Stopping Cascade Approvals||Blair McK||2/26/12 3:14 PM|
You can set a formtool attribute bSyncStatus. I believe it's off by default, and is enabled for some HTML properties.
|Re: [farcry-dev] Stopping Cascade Approvals||James Buckingham||2/27/12 1:56 AM|
I've ended up overwriting the setData and doing a check to see if the Course is the one calling the Fees. Feels like a bit of a hack compared to what you're suggesting though so I'd like to look at that one.
So do I put that in the cfcomponent or define it as a new property, and does that get applied to the Course?
What I don't want to do is switch off all approval processes, just the ones relating to Fees.
|Re: [farcry-dev] Stopping Cascade Approvals||Blair McK||2/27/12 3:14 AM|
It's an attribute of the property - you would add it to your UUID and array properties as required. I think dmHTML in core uses it. I don't know if status is synced by default though.
|Re: [farcry-dev] Stopping Cascade Approvals||James Buckingham||2/27/12 4:33 AM|
Cool, thanks again Blair.
I'll give it a shoot and see what happens.
|Re: [farcry-dev] Stopping Cascade Approvals||James Buckingham||2/28/12 1:35 AM|
Just to feedback bSyncStatus being set to false did the trick :-).
Nice tip actually as I know the Editors here have been complaining about automatic approvals elsewhere so I'll need to look into this one futher.
Thanks again Blair for your time. It's appreciated.