I think this happened because I was on the "create new list" page I didn't enter a "custom send rate" so it gave me an error telling me to put one in. Then I put in a custom rate (20) and then it produced the following error. However, the list did get created in the process.
PDOException: SQLSTATE[23000]:
Integrity constraint violation:
1062 Duplicate entry 'newsletter_list-2-0-0-und' for key 'PRIMARY':
INSERT INTO {field_data_field_newsletter_template}
(entity_type,
entity_id,
revision_id,
bundle,
delta,
language,
field_newsletter_template_target_id,
field_newsletter_template_target_type)
VALUES
(:db_insert_placeholder_0, :db_insert_placeholder_1,
:db_insert_placeholder_2, :db_insert_placeholder_3,
:db_insert_placeholder_4, :db_insert_placeholder_5,
:db_insert_placeholder_6, :db_insert_placeholder_7);
Array (
[:db_insert_placeholder_0] => newsletter_list
[:db_insert_placeholder_1] => 2
[:db_insert_placeholder_2] => 2
[:db_insert_placeholder_3] => newsletter_list
[:db_insert_placeholder_4] => 0
[:db_insert_placeholder_5] => und
[:db_insert_placeholder_6] => 4
[:db_insert_placeholder_7] => newsletter_template )
in field_sql_storage_field_storage_write()
(line 448 of /.../modules/field/modules/field_sql_storage/field_sql_storage.module).
Comments
Comment #1
Reg CreditAttribution: Reg commentedI should mention that I attempted this after upgrading from beta6 to beta8 (skipped 7 as mentioned).
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commentedi had this error some random times as well.couldnt reproduce it..but template saved fine as well so didnt give more attention
it was completely random.but havent see it for a while.
Btw
field_newsletter_template_target_type
shouldnt exist.you should upgrade entityreference module to its latest version ;)Just a wild guess; maybe it has something to do with it
Comment #3
Reg CreditAttribution: Reg commentedI upgraded it, I'll let you know if it crops up again.
Comment #4
Reg CreditAttribution: Reg commentedI might have some idea of what's going on here. Have a look at this:
You do a check for nlid but not list_title however in the DB list title is set through an index as required to be unique. You might need to put some form validation in place to make sure that anything you set as unique is actually not being duplicated by the user before the form is submitted to the the DB, at least in the case of "add".
I put some debug backtrace code just in front of where the error was occurring in common.inc and then looked back through the calls to to this point. Here's the backtrace:
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedThanks a lot, for looking into this more:)
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedCommited a fix.