Field Collections did not originally support revisions; and as a result all field collection revisions of a specific entity were tied to a one specific revision. Basically, a change in the field collections in one revision would change it for the rest. From what I can tell, this is fixed post beta4, however, there is no upgrade path to make this work well.

This issue started originally in #2000690: Deleting revisions via node_revision_delete wrongly deletes entire field collection but I have decided to put it here in its own issue. Primarily comments #18-#21 and #38-#54

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mcpuddin’s picture

mcpuddin’s picture

FileSize
2.49 KB

mcpuddin's module from #2000690-54: Deleting revisions via node_revision_delete wrongly deletes entire field collection that included jmuzz's patch and tried to include nesting but failed miserably with deltas

Leeteq’s picture

DamienMcKenna’s picture

This should be fixed before 1.0 due to the possibility for data corruption / deletion.

jmuzz’s picture

FileSize
6.06 KB

Here's a version that seems to work. I didn't test nested field collections or make a special case for them... I'm not sure they really need to be a special case.

jmuzz’s picture

FileSize
984.66 KB

It does not quite work. Some of the numbers are wrong. Here is a database I'm using to test. This was made by installing field collection beta4, creating a node and making a few revisions of it, upgrading field collection, and then making a few more revisions.

jmuzz’s picture

Status: Needs work » Needs review
FileSize
6.92 KB

This version seems to get my test case right at least. My biggest concern is that this might take too long for large databases and it may need batch support.

jmuzz’s picture

joseph.olstad’s picture

Status: Needs review » Reviewed & tested by the community

patch 8 works well, thanks!

  • ram4nd committed 4fe95e0 on 7.x-1.x authored by jmuzz
    Issue #2339023 by jmuzz, joseph.olstad: Migrate field collection...
ram4nd’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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