When you save a new revision for a node, two new revisions are created for the field collection item. And, only one of those revisions is saved in the field_revision_{field_name} table, leaving a now unusable/orphaned revision.

For reference, I'm using the most recent version from git. After saving a node, I checked the field_collection_item_revision table, and there are two new entries, but only one entry in the corresponding field_revision_{field_name} table.

Comments

m.abdulqader’s picture

Seems revision is not cooked will with field collection, I am facing the same issue.

jstoller’s picture

I'm seeing this same problem. I have a sneaking suspicion it might be related to Workbench Moderation. Are the rest of you also using Workbench Moderation, or Revisioning, or another content moderation module?

m.abdulqader’s picture

I am using workbench moderation

jstoller’s picture

Any module that implements draft revisions in D7 needs to effectively save nodes twice. First to save the new revision and a second time to reset the node table so it points back at the older published revision. My guess is that this is confusing Field Collection somehow and causing it to save two revisions.

What should happen is that Field Collection creates a new revision with the initial node save, but ignores the second node save.

Vacilando’s picture

Priority: Normal » Major

Also bitten by this one. Since this will impact all sites that use revisions I am changing the priority to Major.

jmuzz’s picture

I get what you are saying @Vacilando but for what it's worth it really only impacts sites that use something to allow editing unpublished revisions, which usually means the contrib module workbench moderation. Sites using revisions in core should be able to create new revisions and revert to old ones without this coming up.

jstoller’s picture

There are over 31,000 reported instals on D7 between Workbench Moderation, Revisioning, and State Machine modules and there are probably other modules in this space. I'd guess a good percentage of those are also using Field Collection, so these numbers are not trivial. Personally I'd never build a site without some form of content moderation, but that's just me.

Anonymous’s picture

I too was using workbench_moderation.

I was just looking through their issue queue - the patch from https://www.drupal.org/node/2353491#comment-9670051 against their latest dev has cleared up the double revisions.

osopolar’s picture

jenlampton’s picture

@rsmylski, are you sure that is the correct link? It looks like that patch should only affect file usage counts.

I'm also seeing double revisions with workbench moderation, but I'm not using field collection. For me, every time someone saves a node in "draft" state, two new node revisions are created - with the same timestamp. I'm not sure if that's related to this issue, but it seems likeley.

edit: My issue turned out to be related to the Drafty module.

Anonymous’s picture

Yes - it covers more than just that issue. The crux of it boils down to multiple field_attach_update() calls, which will save the field collection item each time. The patches were eliminating the multiple calls to it.

jenlampton’s picture

Ah okay, makes sense. Thanks for the explanation :)