Stopping Cascade Approvals

19 views
Skip to first unread message

James Buckingham

unread,
Feb 24, 2012, 10:46:19 AM2/24/12
to farcr...@googlegroups.com
Hi group,

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".
https://farcry.jira.com/wiki/display/FCDEV60/Event+Hooks

Is this what's happening here and is there anyway I can turn this off?

Cheers,
James

Sean Coyne

unread,
Feb 24, 2012, 10:49:31 AM2/24/12
to farcr...@googlegroups.com
James,

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.

James Buckingham

unread,
Feb 24, 2012, 11:20:01 AM2/24/12
to farcr...@googlegroups.com
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!

Cheers,
James

Blair McKenzie

unread,
Feb 26, 2012, 6:14:29 PM2/26/12
to farcr...@googlegroups.com
You can set a formtool attribute bSyncStatus. I believe it's off by default, and is enabled for some HTML properties.

Blair


--
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcr...@googlegroups.com
To unsubscribe, email: farcry-dev+...@googlegroups.com
For more options: http://groups.google.com/group/farcry-dev
--------------------------------
Follow us on Twitter: http://twitter.com/farcry

James Buckingham

unread,
Feb 27, 2012, 4:56:53 AM2/27/12
to farcr...@googlegroups.com
Hi Blair,

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.

Cheers again,
James


On Sunday, February 26, 2012 11:14:29 PM UTC, Blair McK wrote:
You can set a formtool attribute bSyncStatus. I believe it's off by default, and is enabled for some HTML properties.

Blair

On Sat, Feb 25, 2012 at 2:46 AM, James Buckingham <clar...@gmail.com> wrote:
Hi group,

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".
https://farcry.jira.com/wiki/display/FCDEV60/Event+Hooks

Is this what's happening here and is there anyway I can turn this off?

Cheers,
James

--
You received this message cos you are subscribed to "farcry-dev" Google group.
To post, email: farcr...@googlegroups.com

Blair McKenzie

unread,
Feb 27, 2012, 6:14:09 AM2/27/12
to farcr...@googlegroups.com
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.

Blair


To unsubscribe, email: farcry-dev+...@googlegroups.com

James Buckingham

unread,
Feb 27, 2012, 7:33:14 AM2/27/12
to farcr...@googlegroups.com
Cool, thanks again Blair.

I'll give it a shoot and see what happens.

Cheers,
James

James Buckingham

unread,
Feb 28, 2012, 4:35:48 AM2/28/12
to farcr...@googlegroups.com
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.

James
Reply all
Reply to author
Forward
0 new messages