Hi,

While trying to create a new node on a clean install with node reminder, I encountered this bug. Following is the step wise description -

1. Install node reminder module and configure it for a content type.
2. The first time I create some content of this type, an entry in the node_reminder table is create with nid 0 which is fine, because the nid is not available for a new node while saving it.
3. The next time I create some new content, step 2 is repeated and I get this error -

"PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY': INSERT INTO {node_reminder} (nid, notify_on, email, amount_of_time, unit_of_time, note) 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); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => 1345006800 [:db_insert_placeholder_2] => admin@localhost.com [:db_insert_placeholder_3] => 7 [:db_insert_placeholder_4] => hours [:db_insert_placeholder_5] => ) in drupal_write_record() (line 7013 of includes/common.inc)."

This is obviously because a new entry with nid 0 is trying to be created again.

4. If I try to just create the node first and edit it later, it fails to save it because the "amount of time" field fails validation.

What is a good solution or work around to this problem?

Thank you,
Swati.

Comments

fizk’s picture

Status: Active » Fixed

I've committed a fix here:

http://drupalcode.org/project/node_reminder.git/commitdiff/b91618e26c2f3...

Let me know if the latest dev release works for you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.