Active
Project:
Content moderation
Version:
6.x-1.9
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Mar 2011 at 00:32 UTC
Updated:
10 May 2011 at 06:10 UTC
Hello,
I am trying to set up a workflow using this module to do something like the following
- user updates a node
- if user has a certain role, the moderation state is automatically set to "review"
- if user has a different role, the moderation state is set to "live"
Is it feasable to create a rule action that would automatically run the transition? I am looking for feedback including pros and cons of doing this. If there is another way to do it, I am open. Either way, I need to do this and am willing to write the code.
Thoughts?
Comments
Comment #1
noahlively commentedAs a followup, since I needed to get this done ASAP for a project, I went ahead and wrote the code using hook_action_info(). I've pasted it below for review from the maintainer / community.
I've done a small amount of testing and so far it is working for me.
It seems like the next natural step would be to add some validation to the action to make sure the state transition is applicable to the current state of the revision, as well as the content type of the node. Perhaps it would be better to change the "from source state to destination state" concept in the action config to simply the destination state.
Comment #2
goldHello Noah,
This is sounding like something that would better live in it's own custom stand alone module that exposes the action to the rules/triggers system. The reason I think this is that there's a few other moderation systems out there that use rules and this is something that would compliment any of them.
With this having sat fallow for so long I'm going to close it for the moment. If you want to provide a patch against head and Eugen is okay with it I'll commit it though.
Comment #3
eugenmayer commentedWell this is a action / rules integration already, so we could stuff it into a submodule already. Iam full ack to not take this into the core module
@noah. Can you bringt this into a submodule so we can easily test on it?