Problem/Motivation
I have a node with a field_collection and have 2 entityreference field value tokens as such:
[field_collection_item:host:node:field-research-area:id]
[field_collection_item:host:node:field-year:id]
This fatal only happens on the first save of the host node's field because the value passed to the token is the stdClass object of the field collection through entityreference_field_validate and doesn't have access to the methods of FieldCollectionItemEntity.
The original stdClass object get's created here entity_form_field_validate which thinks it doesn't have a real object and passes it along as if it were and entity.
Proposed resolution
Ignore non-FieldCollectionItemEntity objects. Since it doesn't effect the first two normal calls to field_collection_tokens with real entities.
Comments
Comment #2
joelpittetComment #3
joelpittetbump, still an issue
Comment #4
joelpittetSorry I put up the wrong patch with the helping code commented out in #2.
We ran the bug again today.
Comment #5
renatog commentedThanks for your patch, it really makes sense
Comment #6
renatog commentedIt was moved to the dev branch in another issue with a similar way
Thank you so much for that