I have set up a content moderation system using WNG and Workflow which is pretty basic in its function:

1. User creates content, moderator gets an email
2. Moderator revises or approves content, author gets an email
3. Author revises content, moderator gets an email

It's #3 that's giving me fits. I have tried several approaches, but whenever #3 is activated, it ends up sending out hundreds of duplicate emails to the moderators instead of just one. This is driving me crazy, and making me look incompetent because I can't solve the problem.

The action in question is "Send a mail to an arbitrary address". I have it going to 3 addresses, each separated by a comma in the proper field in my rule configuration. I have tried two approaches: a) triggered when author updates content and b) triggered when workflow is updated (with the action segregated into its own rule even). Both create the email flood problem.

What am I missing here? Is it because I've got it sending to 3 addresses? They all get the 100's of emails, and have to block the mail server from receiving to stop the flood. Do I need to trigger differently or add another condition?

I'll be happy to provide extensive details of my rule configs, etc to get some advice. Other than this issue, my setup seems to work fine. I really need to get the email problem worked out, as it's holding up the launch of the site.

Thanks to anyone who can help!

Comments

quixote’s picture

Update/More Info:

After digging around in the workflow_ng module code, I believe I have isolated the offending function inside workflow_ng_system.inc. The function workflow_ng_action_mail is hanging for some reason. It's strange because all this function really does is pass the buck to the workflow_ng_action_mail_to_user function.

To debug, inside workflow_ng_action_mail I commented out the reference to the other function, and placed some output code to see what's going on. The loop still occurs, and repeats my output code some 900 times before PHP cuts it off with a "Maximum execution time of 30 seconds exceeded" error, which kills the loop.

There are not enough clues in this part of the code for me to know what's going wrong, or where to look next. Fago, can you give me some idea? If you need more info, please let me know.