Some users have reported errors like (#781088-111: Updating CCK Fields and Data from D6 to D7)

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=8285&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node-2381-0-0-und' for key 'PRIMARY': INSERT INTO {field_data_field_hon_id} (entity_type, bundle, entity_id, revision_id, language, delta, field_hon_id_value) 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] => node [:db_insert_placeholder_1] => continuouspublication [:db_insert_placeholder_2] => 2381 [:db_insert_placeholder_3] => 7723 [:db_insert_placeholder_4] => und [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => CP00002 ) in drupal_write_record() (line 6776 of /Users/cnolle/Desktop/dev/cope7/includes/common.inc).

in the content migrate module.

I've had this error as well on nodes which have several revisions. I think we should only be inserting the most-recent revision into field_data_field_NAME, instead of all revisions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bfroehle’s picture

Status: Active » Needs review
FileSize
1.81 KB

Is this a correct approach in fixing things? It works for me at least...

bfroehle’s picture

Title: PDOException: Integrity constraint violation: 1062 Duplicate entry 'node-2381-0-0-und' ... » Content Migrate fails for nodes with revisions
FileSize
5.69 KB

Including the same patch as in #1, and a test routine. :)

KarenS’s picture

Status: Needs review » Fixed

Works great for me, committed.

I think there is something wrong with the tests (not just these tests, all tests), I am only seeing the data setup, not the tests themselves. I'm going to create a separate issue for that though, I believe the revision handling is now working right.

bfroehle’s picture

KarenS’s picture

Yeah, I suspected that. Can you please link those two issues together?

bfroehle’s picture

Sorry, I don't know what you mean.

KarenS’s picture

Post a comment on each one with a link to the other. They're not duplicates, but they're related.

Status: Fixed » Closed (fixed)

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