I tested this with a clean install. Add a new field collection item with the embedded form when editing a node and it will be archived afterwards if you made a new revision for the node. I think it's because of some changes that were made to help support modules that allow you to make new revisions that don't get published immediately, but it happens when you just use Drupal's default revisioning system if you check create new revision under publishing options when doing the edit.

CommentFileSizeAuthor
#1 field_collection-cc-2125017-1.patch1.05 KBjmuzz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jmuzz’s picture

Status: Active » Needs review
FileSize
1.05 KB

Some of the checks called from field_collection_field_update are returning incorrect values because of cached data in the node. I determined this by running the check multiple times during node_save(), the incorrect value was returned until the cache clear happened at the end.

I have a patch for it with an added cache clear on the item before the check is done. It shouldn't be as bad as it sounds because this cache clear is done at the end of node_save() in node.module anyway and the patch just adds one more call to it.

dealancer’s picture

dealancer’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Works perfect! Also changed status to major, us without this patch field collection does not update current revision in some cases.

capmex’s picture

I experienced the same issue when adding a field collection with a different user than user/1. All field collections added did not displayed the edit|delete links and on the field_collection_info table they appeared as archived (value 1).

The patch fixed this issue.

  • jmuzz committed cedb1d3 on 7.x-1.x
    Issue #2125017: Fixed field collection items being created as archived...
jmuzz’s picture

Status: Reviewed & tested by the community » Fixed

Also added a test case for it.

Status: Fixed » Closed (fixed)

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

jedihe’s picture

Since the committed patch doesn't fix the already inconsistent data at the database level, I think it may be of help to anyone troubleshooting this to look into a helper drush script I wrote for identifying the nodes/fields with the said inconsistency. You can find it on this comment (#2416237).