Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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(
Comment | File | Size | Author |
---|---|---|---|
#3 | simplenews-fix_simplenews_rules-1959790-3.patch | 3.01 KB | PascalAnimateur |
#2 | simplenews-fix_simplenews_rules-1959790-2.patch | 1.92 KB | PascalAnimateur |
Comments
Comment #1
tchopshop CreditAttribution: tchopshop commentedTHANK YOU!
Comment #2
PascalAnimateur CreditAttribution: PascalAnimateur commentedI fixed the problem the other way around: by renaming 'tid' to 'newsletter_id' everywhere else :)
Here's a patch...
Comment #3
PascalAnimateur CreditAttribution: PascalAnimateur commentedBetter patch that also fixes rules actions for unsubscribe / subscription_delete.