Active
Project:
Simplenews
Version:
7.x-1.0
Component:
User interface
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2013 at 16:45 UTC
Updated:
29 Apr 2015 at 14:17 UTC
Jump to comment: Most recent
I constantly get the following error when trying to mass subscribe emails.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'tid' cannot be null: INSERT INTO {simplenews_subscription} (tid, snid, status, timestamp, source) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 22 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => 1361542568 [:db_insert_placeholder_4] => ) in simplenews_subscription_save() (line 1501 of sites/all/modules/simplenews/simplenews.module).
Any help appreciated!
Comments
Comment #1
Ronni-1 commentedim facing the same issue. Did u find any solution to this?
Comment #2
andreic commentedI manually removed the taxonomy instead removing the correlated category in the Simplenews settings first. Here how i did it step by step:
One patch had to be added to the simplenews realname module:
Look for the line:*
$checked_newsletters = array_filter($form_state['values']['newsletters']);
Replace it with:
$checked_newsletters = array_keys(array_filter($form_state['values']['newsletters']));
And the following steps to clear all Simplenews data and create a clean new install:
You now have to reconnect the newsletter categories with the taxonomy TID.
The easiest way to do that is to uninstall the simplenews, simplenews_realname and the simplenews_rule modules by first disabling the module and the going to the uninstall tab, that will delete the tables on the DB. To make sure there was no extra info left on the site registry run this query in phpMyAdmin or your DB management software:
SELECT * FROM `variable` WHERE `name` LIKE '%simplenews%'
If there are values returned, make sure to remove them before continuing. The most important to delete is "simplenews_vid" as that is the simplenews vocabulary ID or machine name.
Then delete all newsletter taxonomies
And delete the category field from the newsletter content type. it will be automatically added again during the new install. If this step isn't done, the categories won't work with the content type, as they point to a non existing vocabulary.
The next step is re-enable the modules simplenews first then simplenews_realname, and last simplenews_rules. This last step will create a new taxonomy vocabulary called "Newsletter", please don't delete it, but if you want you can rename it, now keep in mind that the name of this vocabulary is inserted by default on the email subject when the newsletter is sent, so that it makes sense to keep it as "Newsletter".
To add or remove categories for the newsletter DO NOT do it from the taxonomy section instead go to the Configuration > Newsletter and add them and remove them from there.
Comment #3
Ronni-1 commentedI get this error when i re-enable the simplenews-realname module.
DatabaseSchemaObjectExistsException: Table <em class="placeholder">simplenews_realname</em> already exists. in DatabaseSchema->createTable() (line 657 of /includes/database/schema.inc).Comment #4
redhatusr commentedI get this error without the simplenews_realname module installed
anyone has a solution?