I made a webform, which has a yes/no question about subscription.

After it, I created a rule to subscribe the user to a newsletter. But it throws an Integrity Constraint error.

After some inspection a realized that the functions wants 'tid' array key, but the form returns 'newsletter_id' key.

So I changed the form field key:

simplenews/simplenews_rules/simplenews_rules.rules.inc line 37

-        'newsletter_id' => array(
+        'tid' => array(
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tchopshop’s picture

Issue summary: View changes

THANK YOU!

PascalAnimateur’s picture

I fixed the problem the other way around: by renaming 'tid' to 'newsletter_id' everywhere else :)

Here's a patch...

PascalAnimateur’s picture

Better patch that also fixes rules actions for unsubscribe / subscription_delete.