Hi All,

I've created a custom subscription 'all' to react on a 'Node' type events for 3 different node types.
When user clicks to subscribe to 'all' the module tries to enter duplicate values to notifications_fields table. Error message is below:
--
user warning: Duplicate entry '11-type' for key 1 query: INSERT INTO notifications_fields (sid, field, value, intval) VALUES(11, 'type', 'articles', 0) in /var/www/XXXXXX/sites/all/modules/notifications/includes/notifications_subscription.class.inc on line 422.
user warning: Duplicate entry '11-type' for key 1 query: INSERT INTO notifications_fields (sid, field, value, intval) VALUES(11, 'type', 'news', 0) in /var/www/XXXXXX/sites/all/modules/notifications/includes/notifications_subscription.class.inc on line 422.
--

Is it a bug or I just misuse the custom subscriptions module?

Comments

chirale’s picture

Version: 6.x-4.0-beta7 » 6.x-4.x-dev

Same issue here using multiple Custom Subscriptions (on registration) via taxonomy.

Duplicate entry "3879-tid" for key 1 query: INSERT INTO notifications_fields (sid, field, value, intval) VALUES(3879, "tid", "81", 81);

bochen87’s picture

Version: 6.x-4.0-beta6 » 6.x-4.0-beta7

same issue here.

The problem is also if this happens, somehow the notifications stop working. I have to uninstall the messaging and notification module to make it work again.

The problem is, that the primary key in notifications_fields consists of "sid" and "field". This will not be unique if you have more than one content type inside it.

But I still dont know why it completely stops working after that.

ethnovode’s picture

Same problem if I have 2 or more taxonomy terms in the subscription. No problem if I have 1 taxonomy term and 1 content type.
The warning shows when saving the second taxonomy term or when I assign the subscription that has 2 taxonomy terms to a user (and the subscription is not sending any emails).