I'm currently developing a community website and this module is exactly what I needed to let my users add as many professional experience (grouping fields such title, description, etc... ) that they want, so great work !

However I just discovered a strange behavior when I approve the form in the administrative panel. I do see the value that the users filled, but when I save, everything disappear ! (From the form and the profile page). I checked on the database and all the values are still in but they do not display on the site anymore... This also appeared when the user modify his datas. But this seems to happen only in the first saving... quite strange...

I use the embed form of the latest dev release and I embedded a form collection within an other form collection but I'm not sure this is related...

I will try to investigate the problem but I'd like to know first if some of you have already encountered this problem. I'm quite new in Drupal development and some help would be great ! :)

Comments

Anonymous’s picture

So I finally tested the same process with the new dev release from today and I get an error message :

Exception : The host entity may be set only during creation of a field-collection item. dans FieldCollectionItemEntity->setHostEntity() (ligne 191 dans /www/drupal7/sites/all/modules/field_collection/field_collection.module).

Some field collection are displayed in the registration form, and the other are displayed are shown only in the edit page. Can this have an impact on the is_new parameter ?

I'm a bit lost....

munkyonline’s picture

Looks like the same issue described here: http://drupal.org/node/1204428 and http://drupal.org/node/1205670

Anonymous’s picture

Thanks for your comment munkyonline, I was desperate to think I was the only one to have this problem - which make me reconsider to use this plugin as I simply cannot use it for the moment - but you're right, the other issues look similar.

I cannot work often on that project so I'm moving slowly and I didn't find the origin of that yet. I use basic content in my form (autocomplete term, multiline field, text field) and no Image field, but I use one field collection inside an other. I thought it was the problem but I did several test without and it's the same... I also have some collection field in the registration page and some other not and I thought it was the reason the plugin try to set the host entity again but it doesn't seem to be that also.

Commented the 191 line as a guy did in 1204428 issues avoid the error message but still empty the form so I will continue to investigate today...

If you have some ideas, feel free to share it ! :)

munkyonline’s picture

I think if you change the form to hidden instead of embedded then it should work. It may be something to do with the node form running a function that is trying to create the entity through the embedded form when it has already been created. The embedded field collection seems to stop any form from saving new content.

Anonymous’s picture

I was wondering if the problem wasn't in field_collection_field_widget_embed_validate. It seems that after this function, the "presave" function is always called and this one always called setHostEntity even if the item isn't new... What do you think ?

fago’s picture

Status: Active » Closed (duplicate)

>Exception : The host entity may be set only during creation of a field-collection item. dans FieldCollectionItemEntity->setHostEntity() (ligne 191 dans /www/drupal7/sites/all/modules/field_collection/field_collection.module).

Let's handle this in http://drupal.org/node/1204428