(This may be a bug in messaging instead of notifications.)

Error message:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'send_method' cannot be null: UPDATE {notifications_subscription} SET send_method=:db_update_placeholder_0 WHERE (send_method = :db_condition_placeholder_0) ; Array ( [:db_update_placeholder_0] => [:db_condition_placeholder_0] => mail ) in notifications_messaging_method() (line 1033 of /Users/sharplesa/Sites/n/sites/all/modules/notifications/notifications.module).

How to reproduce:

  1. Configure messaging and notifications so that messaging actually works, and you receive an email notification for a subscribed object. In my case, I used Messaging/Simple Mail.
  2. Create a subscription that uses Simple Mail.
  3. Go to admin/modules and uncheck all messaging types, including the Simple Mail messaging type.
  4. Click "Save configuration"
  5. Observe that you get the error message similar to the one shown above. This error is in function notifications_messaging_method($op, $method, $param). $op = 'replace'. $method = 'mail', $param = NULL.

The problem appears to be that you cannot set the column send_method to NULL in the table notifications_subscription.

Would it make sense to check $param, and if ($op=='replace' && $param==NULL), set $op to 'disable' and throw a warning drupal_set_message()?

Comments

agerson’s picture

Happening to me as well