I have a issue where field_collection_item table has a different revision then the highest revision inside the revision table (field_collection_item_revision).

What i have noticed that the functions returns the revision inside field_collection_item table:

field_collection_item_load_multiple(array('437436'))
entity_load('field_collection_item', array('437436'))

The follow won't use the table and select on highest revision number inside field_collection_item_revision:

Node edit page aka node/*/edit
node_load('942391')

The actual problem is that field_collection_item sometimes won't get updated when altering a node..

Anyone have the same problem?

Comments

jproctor’s picture

I've also had this problem, on two different field collections. So far it has been rare (four known instances across 44000+ revisions).

In all cases, a little database surgery to update field_collection_item with the correct revision_id (and put the correct data and revision_id into the field_data_... table) was sufficient to clear out the dissociation, but we'd obviously prefer it never happen.

One of the field collections contains entity references, and when it got out of synch, host_entity_path also failed.

schiavone’s picture

We're having the same issue. New field collection instances are not given the latest revision id and this causes edit links to disappear in the node display and errors like...

Exception: Unable to save a field collection item without a valid reference to a host entity. in FieldCollectionItemEntity->save() (line 503 of /srv/bindings/6eb01ddc99ed43eb8561839a066cc121/code/sites/all/modules/contrib/field_collection/field_collection.module).

Scrubbing the data resolves the issue but it would be nice to track down the cause and patch.

Canu667’s picture

We are having the same problem. It usually appears, when we add two or more field collections of a given type or when the CMS user reverts node data to a previous revision. Updating the table field_collection helps, however, this is not an acceptable solution for our customer.

ann b’s picture

Title: Bug Revisions and field_collection_item » field_collection_item.revision_id Not Generated Correctly
Priority: Normal » Major

Sorry, after rereading this issue, I see my problem is unrelated. I will open a new issue.

ann b’s picture

Version: 7.x-1.0-beta7 » 7.x-1.x-dev
ann b’s picture

Title: field_collection_item.revision_id Not Generated Correctly » Bug Revisions and field_collection_item
Version: 7.x-1.x-dev » 7.x-1.0-beta7
Priority: Major » Normal