Posted by chintan4u on September 5, 2011 at 11:04am
I want to add a workflow for unpublished content using Rules.
scenario is like this:
1.The normal user can request to unpublish content.
2.A mail wiil go to admin & editor that "xyz content is pending for unpublish"
3.Admin will review it & whtever action will take.
Now here in point 1, I want to create an event " request for unpublish content"
I referred this post but my idea is not clear for this case
http://drupal.org/node/298549
in short i need action "pre unpublish" like we have presave.
any suggestion ....guys...??
Comments
Node save
You don't really need a new event – all you need is some kind of data to keep track of the state of the content. Something like this:
If you want, you can also have the unpublish field reset when the content is actually unpublished (but it might be a good idea to keep that information).
This solution requires that users can edit the content, to request the unpublishing. If this is not the case, then it is probably easiest to use the Flag module instead of the field. (The you will also have the event "content has been flagged with 'request for unpublishing'", which should be useful.)
Good luck!
//Johan Falk
**
Check out NodeOne's Drupal Learning Library! 150+ screencasts and exercises, for Drupal introduction, advanced configuration, and coding.
Hey ... Thanks Johan
-I used a checkbox for "request for unpublish"
-sending mail if "request for unpublish" checkbox is check.
Here my admin/editor are now receiving 2 mails.
-one mail for "request for unpublishing"
-another mail for resource updation (I have another rule on updation of content)
now I m looking for workaround so admin will receive only 1 mail for "request for unpublish" not for update.
Additional condition checks
I think the best way to do this is to add another condition to the resource update notification, using the same conditions as for "request for unpublishing" – but negated. Thus, you send out the update notification if the content was not requested for unpublishing.
If you're using Rules 2 (Drupal 7), then you can package all the conditions into a condition component, making it easy to re-use the same configuration in several places.
Good luck,
//Johan Falk
**
Check out NodeOne's Drupal Learning Library! 180+ screencasts and exercises, for Drupal introduction, advanced configuration, and coding. Creative Commons license!
Fix the other rule
Make its conditions stricter. You don't have to check "request for unpublish" in it; instead, I would rather check if anything else has changed. If not, ignore it.
So the admin can still get 2 mails for one update, if :