I'm running workbench_email on Acquia using PHP 5.6 and when sending emails on state change my logs are flooded with PHP notices, as follows:

Notice: Undefined index: illustrate in workbench_email_form() (line 157 of docroot/sites/all/modules/contrib/workbench_email/workbench_email.admin.inc).
Notice: Undefined index: copy_edit in workbench_email_form() (line 157 of docroot/sites/all/modules/contrib/workbench_email/workbench_email.admin.inc).

Emails are also not being sent, but that may be another unrelated issue. Edit: emails are sending now. Hitting "save" on the admin form seemed to fix them (?) even though no changes were made.

Comments

jenlampton created an issue. See original summary.

frosev’s picture

Thanks @jenlampton. The code in question fetches the state labels using the function workbench_moderation_state_labels. It's iterating over each of the states' transitions. I'll try to reproduce the issue. Could you provide me with a screenshot of your configuration for workbench_email and workbench_moderation states and transitions?

frosev’s picture

Assigned: Unassigned » frosev
jenlampton’s picture

Thanks :)

Here's workbench email

Here's moderation:

jenlampton’s picture

Issue summary: View changes
frosev’s picture

Thank you. That's odd, the two transitions "illustrate" and "copy_edit" don't seem to be presented in the moderation screen. I've got a hunch that the workbench_emails table may still have the email settings for those two transitions/states in it's own table.

If you have access to the database could you do a quick query of that table and provide a screenshot?

If my above hunch is correct, we'll need to figure out why those records weren't purged.

frosev’s picture

Hi @jenlampton,

Do you have a status update on this issue? Or were you able to resolve this issue?

tobiasb’s picture

Version: 7.x-3.11 » 7.x-3.12
Category: Task » Bug report
Status: Active » Needs review
StatusFileSize
new1.16 KB

When a user deletes some workbench-mod states, then workbench-email should delete all sets where from/to_name is not anymore a state. Perhaps it is a good idea to add a update hook to do this also.

tobiasb’s picture

StatusFileSize
new1.24 KB

Remove also sets with invalid roles.

frosev’s picture

StatusFileSize
new1.77 KB

Thanks tobiasb,

I've reworked the function workbench_email_delete and made use of hook_workbench_moderation_state_delete and hook_workbench_moderation_transition_delete to delete the necessary email templates.

larowlan’s picture

Status: Needs review » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.