We have found that Drupal will produce a fatal error (white screen of death) if the node author is set to anonymous, the Workbench Email form selection is displayed when the state is changed, and no other updates are made to set which users are notified. The error generated is as follows:
PDOException: in drupal_write_record() (line 7603 of /includes/common.inc).
Enable Workbench Email for a node, set states of "draft" and "publish", and have the email form selection be displayed when switching from draft to publish. Create the node, set the node author to anonymous (blank), and change the node state to "publish".
At that moment, it can be seen the "Original Author" select form item has been generated, and the initial entry (with a value of nothing) is set as selected in the HTML. This is the critical problem -- the code will then attempt to send an email to a user that has no address. Since this is the anonymous user, it generates a critical error.
See the attached patch. It is simple enough to check for anonymous account records when filtering users, and skip them if present. This will ensure they are not included in the Workbench Email selects.
This patch is somewhat of a continuation of a committed patch from a few years ago, which was for anonymous users submitting nodes, whereas this situation is for administrative users submitting nodes and setting the author to anonymous: https://www.drupal.org/project/workbench_email/issues/2529016 β
Please review the attached patch and let me know if any further updates are necessary. Thank you.
Needs review
3.12
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.