I have bunch of nested field collection added within a content type. It works fine in view page but in edit page the contents of nested field collection is blank.

Comments

kscheirer’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

I've been trying out nested field collections and the view/edit pages seem fine. Can you test against the latest dev version (7.x-1.0-beta4+14-dev) and provide more detail on how to reproduce this bug?

eristoddle’s picture

I am also having this same issue. I applied this patch: http://drupal.org/node/1316162 to get translation to work. It does seems to be intermittent though. Some of my nodes show the values in the field collection form and some don't. But the count of the repeating fields is correct. If I add 6 field collections, there will be 6 empty fields. Just wanted to chime in that more than one person is having this issue. Now hunting down a fix, because it has to be fixed for this site to work.

jay.dansand’s picture

I just updated to beta5 and lost all content on my nested items. The previous version in use was beta4+10-dev, before the revision support was added.

The field collection has an unlimited cardinality and is comprised of a thumbnail, date, and body field. All 3 of those fields are now blank. If it matters, I am using Workbench Moderation, though the content type in question is not revisioned by default. I'm also using Fieldgroup to expand/collapse the field collection items on the edit page.

Post-update, I have a dblog peppered with "Notice: Undefined index: revision_id in field_collection_field_get_entity() (line 1589 of .../sites/all/modules/field_collection/field_collection.module)" errors, where there used to be none.

jay.dansand’s picture

I just applied these 3 patches against 7.x-1.x-dev:

  1. #1807460: Field collection doesn't play nice with workbench moderation (patch) (comment #1)
  2. #1866032: EntityFieldQueryException: Unknown field (comment #7)
  3. #1822844: Notice: Undefined index: revision_id in field_collection_field_get_entity() (line 1586 of field_collection/field_collection.modu (comment #16)

My field collection items have reappeared on the edit form, so this issue is (likely) solved by one of (or the combination of) those patches. @ghalenir and @eristoddle, can you try those patches and see if your issue is resolved as well? Best of luck!

eristoddle’s picture

Checking further into this, it seems that the embedded field collection does not take on the language of the node when it is initially saved. Even though the node itself is in English, the collection saves as und. And the field does display on the frontend. Just not when editing. It is interesting that as soon as I go to make a Spanish translation, which errors because of another bug(Entity malformed on line 7633 in common.inc), then the data is in the edit fields the next time I check. But the translation never save because of the entity error.

Anonymous’s picture

Encountering the same issue with nested field collection. I am new to Field collection and just discovered the power of nesting a field collection inside another field collection. It is extremely helpful for layout of the content in the associated views. The more I use this Field Collection module, the more amazing it becomes!

I am also building a multi-lingual site and running into this problem. I enabled field translation, but that did not help. Any updates much appreciated.

kscheirer’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active

Thanks for the bug reports, this seems like a pretty important issue to resolve. Marking critical for that, and active to hopefully attract a patch or see if the patches listed in #4 resolve the problem.

Anonymous’s picture

Implemented all three patches in #4 but no change. Field collections, nested or not, remain blank when editing content. Definitely a "show stopper" bug as I need this content type to be accessible to site users, not just the admin.

Anonymous’s picture

This post may have some connection the problem identified here:

http://drupal.org/node/1344672

Anonymous’s picture

Just an FYI. This patch "may" work for you to at least see the editable content in the default language. It is a real bear to input and I recommend making a backup of each file.

Current patch is in comment #17:
http://drupal.org/node/1344672

Link to patch:

http://drupal.org/files/field_collection-entity_translation-1344672-17.p...

Save the file(s) several times as you enter the patch it is not a short task, budget at least 30 minutes to enter the changes.

Patched applied and I can now see the data in field collections on edit. Note only seems to work for "newly added" content.

kscheirer’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Hmm, so this could be a duplicate of #1344672: Field Collection: Field translation (entity_translation) support.? That would make this issue easy to close out. If it's not a dupe, we could use some instructions on how to reproduce this bug, and test it out against the latest dev version (7.x-1.0-beta5+1-dev).

Anonymous’s picture

I am still not able to reliability edit field collections despite applying the patches.

I can now edit the first field collection on a node, but not a second field collection. Also, if I choose to "add another" to the first field collection, this second entry is not editable.

Issue is probably a duplicate of #1344672: Field Collection: Field translation (entity_translation) support but the patch is not a complete solution.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Needs review

For what it is worth, just applied latest dev version as part of routine drush up operation and received following warning:

Invalid edit path defined for entities of type Field collection item:[warning]
matching menu item not found for
field_collection_item/%field_collection_item/edit

I also received this warning, but I had just disabled translation on my two field collections a moment before as part of troubleshooting. Not sure what to make of these warnings. Here is the warning messages in their entirety:

Invalid base path defined for entities of type Field collection item: matching menu item not found for [warning]
field_collection_item/%field_collection_item
Invalid view path defined for entities of type Field collection item: matching menu item not found for [warning]
field_collection_item/%field_collection_item
Invalid edit path defined for entities of type Field collection item: matching menu item not found for [warning]
field_collection_item/%field_collection_item/edit
Invalid translate path defined for entities of type Field collection item: parent menu item not found for [warning]
field_collection_item/%field_collection_item
The entities of type Field collection item do not define a valid path scheme: it will not be possible to translate them. [warning]

Anonymous’s picture

Title: Nested fileld collection content not showing in edit page » Nested field collection content not showing in edit page

corrected title to "field" collection.

jmuzz’s picture

If you are seeing this issue while using the entity translation patch from #1344672: Field Collection: Field translation (entity_translation) support. then please try the latest version of the patch. I was able to duplicate this issue before but since the latest version of that patch it seems to be working correctly for me.

Can anybody make this happen -without- the entity translation patch?

Is it still happening for anybody with the latest version of the entity translation patch? Data entered before this version will likely not appear with the patch but I believe newly entered data should appear on the edit form. If you want to try making your previously entered data usable you can try setting the language for their entries in the database; They may be incorrectly set to 'und'

andrezstar’s picture

still aint working.
Same issue here.

Uploading pics on create form and Cannot see them on edit form
But if you edit them and upload them again you finally see them

SOOO WEIRD.

Edit: jmuzz, im using this entity translation patch and its not working. The images are uploaded correctly, but when editing the form -for the 1st time-, aint fetching them right. On the other hand, when uploading them again (from the editing form) and saving and editing again, there they are. Weird, isnt it?

jamsilver’s picture

Issue summary: View changes

I know I'm not adding much here, but for what it's worth I'm trying to make field collections work inside paragraphs and with all the relevant modules running at their latest versions, including the latest entity translation support, I'm still seeing odd behaviour, similar to that described above. It looks like there's still work to do to realise the arbitrarily-nested entity_translation dream :).

Nice work to all involved though, it has come a long way!