Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#8 | field_collection-fix_old_revisions-2339023-8.patch | 7.88 KB | jmuzz |
| |||
#6 | fcrev.sql_.txt | 984.66 KB | jmuzz |
Comments
Comment #1
mcpuddin CreditAttribution: mcpuddin commentedjmuzz's original patch on #2000690-21: Deleting revisions via node_revision_delete wrongly deletes entire field collection
Comment #2
mcpuddin CreditAttribution: mcpuddin commentedmcpuddin'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
Comment #3
Leeteq CreditAttribution: Leeteq commentedComment #4
DamienMcKennaThis should be fixed before 1.0 due to the possibility for data corruption / deletion.
Comment #5
jmuzz CreditAttribution: jmuzz commentedHere'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.
Comment #6
jmuzz CreditAttribution: jmuzz commentedIt 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.
Comment #7
jmuzz CreditAttribution: jmuzz commentedThis 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.
Comment #8
jmuzz CreditAttribution: jmuzz commentedBatch support added.
Comment #9
joseph.olstadpatch 8 works well, thanks!
Comment #11
ram4nd CreditAttribution: ram4nd as a volunteer commented