Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Got this when trying to add a contact, this was from a fresh install, all modules enabled, all I did was create a contact type called 'client' and tried to add one. Tried a few times with different data, always the same result.
/redhen/contact/add/client
Integrity constraint violation: 1062 Duplicate entry '4' for key 'PRIMARY': INSERT INTO {redhen_contact_revision}
Module is looking good though, Drupal has been sorely lacking this for a long time.
Comment | File | Size | Author |
---|---|---|---|
#17 | remove-revision-creation-6730834-17.patch | 2.53 KB | nedjo |
#11 | remove-revision-creation_6730834_11.patch | 1.26 KB | valderama |
#10 | remove-revision-creation_6730834_10.patch | 718 bytes | valderama |
Comments
Comment #1
levelos CreditAttribution: levelos commentedCan't reproduce. Please try again with the latest code base.
Comment #2
rHOnDO CreditAttribution: rHOnDO commentedSame issue and I am using the 7.x-1.x-dev dated 2012-Sep-17.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '29' for key 'PRIMARY': INSERT INTO {redhen_contact_revision} (contact_id, revision_id, author_uid, first_name, last_name, redhen_state, updated) 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); Array ( [:db_insert_placeholder_0] => 28 [:db_insert_placeholder_1] => 29 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => Bruce [:db_insert_placeholder_4] => Wayne [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1349195326 ) in drupal_write_record() (line 7036 of /var/aegir/.../includes/common.inc)
Comment #3
rHOnDO CreditAttribution: rHOnDO commentedSee my post above (#2)
Comment #4
rHOnDO CreditAttribution: rHOnDO commentedTried again today with the Oct. 2nd dev version.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '33' for key 'PRIMARY': INSERT INTO {redhen_contact_revision} (contact_id, revision_id, author_uid, first_name, last_name, redhen_state, updated) 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); Array ( [:db_insert_placeholder_0] => 32 [:db_insert_placeholder_1] => 33 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => Robert [:db_insert_placeholder_4] => Redfern [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1349308079 ) in drupal_write_record() (line 7036 of /var/aegir/.../includes/common.inc).
Comment #5
levelos CreditAttribution: levelos commentedStill unable to recreate. My guess is that are lingering tables/data from an old version. When you say fresh install, are you sure you deleted the entire database before reinstalling? We've got hundreds of users at this point and no one else is reporting this issue ...
Comment #6
stevep CreditAttribution: stevep commentedSame problem
Fresh install = new database + "minimal" modules enabled, including pathauto, token etc.
Modules:
Redhen 7.x-1.0-beta3+2-dev 2012-Oct-27
Entity API 7.x-1.0-rc3+11-dev 2012-Oct-24
on Ubuntu local server PHP 5.3.10-1ubuntu3.4
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4' for key 'PRIMARY': INSERT INTO {redhen_contact_revision} (contact_id, revision_id, author_uid, first_name, last_name, redhen_state, updated) 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); Array ( [:db_insert_placeholder_0] => 4 [:db_insert_placeholder_1] => 4 [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => Fred [:db_insert_placeholder_4] => Nirk [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1351372483 ) in drupal_write_record() (line 7036 of /var/www/drupal7/includes/common.inc).
-----------------------> Update
Installed RedHen CRM Demo (7.x-1.x-dev | 2012-Oct-19 ) working fine. Above problem appears related to incorrect setup.
Comment #7
valderama CreditAttribution: valderama commentedHaving the same issue here.
Comment #8
valderama CreditAttribution: valderama commentedI could "solve" the issue by removing the drupal_write_record call in the contact entity controller (line 45). It seems as the revision of the new contact was about to be created twice - therefor the duplicate PRIMARY key. The error is gone then, and I can create contacts without any problem. Also a revision entry for each contact is created in the redhen_contact_revision table.
I do not know much about the internals of entities, but might it be possible that latest dev of Entity API may takes care of creating the revisions already?
Comment #9
valderama CreditAttribution: valderama commentedSee also this issue over there at Entity API about revisions. Seems revision support got into dev - somewhat silently: http://drupal.org/node/996696
Comment #10
valderama CreditAttribution: valderama commentedComment #11
valderama CreditAttribution: valderama commentedWas a bit to fast with the first patch. This one now takes care of correct revision creation on update.
Comment #12
valderama CreditAttribution: valderama commentedChanging title
Comment #13
seanberto CreditAttribution: seanberto commentedBumping priority. We'll address this asap. (Hectic two weeks here with the holidays....)
Comment #14
seanberto CreditAttribution: seanberto commentedComment #15
seanberto CreditAttribution: seanberto commentedSee #1776868: add support for Entity API revisions
Comment #16
nedjoI'm getting this error in the Debut RedHen app after updating to Entity 1.0. This is a blocker for a new Open Outreach release, see #1874958: Issue RC8 Open Outreach release with security updates.
Comment #17
nedjoQuick untested update to patch. Looks to contain a stray change, but I don't have time ATM to fix.
Comment #18
levelos CreditAttribution: levelos commentedThanks @nedjo, that works great. Committed.
Comment #19
jhoffmcd CreditAttribution: jhoffmcd commentedI've been getting this error when trying to update a contact through a relations endpoint:
I though it might be related to this patch but when I used it I now get:
Fatal error: Class 'RedhenContactEntityController' not found in ..\www\includes\common.inc on line 7679
Now I'm not sure whether or not I just didn't apply the patch right... Am I right in assuming my original errors were caused by the issue discussed in this post?
EDIT: This did work for me, the error that I got was from the file's permissions being changed for some reason.
Comment #20
danielbeeke2 CreditAttribution: danielbeeke2 commentedHow to use these revisions?
I have searched the code for clues, but it looks partly intergrated with the dev version.
Comment #21
nedjoThis patch didn't add any UI elements but just switched out some custom handling for the new Entity API CRUD handling of revisions. What's done with revisions is still the same as before: each time an edit is made, it's saved as a new revision.
We would need new issues and patches for things like:
Comment #22
danielbeeke2 CreditAttribution: danielbeeke2 commentedAh I see, thanks!