I would like to programatically set/override the default states and transitions. The attached patch provides for this. I factored out the INSERT statements to the enable_hook instead of the install_hook, which I understand needs to be addressed to avoid duplicates.

This patch allows you to set/override the defaults by changing/adding to $params->states or $params->transitions. However, this is probably not a final design destination, merely a starting point.

Comments

eugenmayer’s picture

Could you please explaint, what your goal is. there is an UI to set states and configure them. if you want to programmatically add / remove, we need features support for exporting those?

dparks’s picture

The goal is to allow other module developers (rather than site administrators) to programatically set/override the states and transitions. Though, having this exportable in a feature would also be useful.

dparks’s picture

New patch w/bugfix; from/to/type values were not being inserted.

eugenmayer’s picture

Actually i still dont get it. Do you want to add / remove transitations and states or somehow do some overrides "runtime" when some status-changes happen?

dparks’s picture

I want to pre-define states and transitions. I want to use names different than the defaults (none, review, approve, live); moreover, I might want to make one or more of those names "disappear".

I'm not trying to do anything at runtime that this module currently isn't capable of.

eugenmayer’s picture

Ok so thats exactly what the UI is for - but doing it programatically?

eugenmayer’s picture

Status: Active » Postponed (maintainer needs more info)

Skipping for 1.5 as iam not 100% sure about this yet. Still needs information what is the issue, what we need this and what alternatives we have.

Thanks for your time and effort!