I use paragraphs and commerce products references fields. In this case, display_cache_field_attach_view_alter() does not have $output['#bundle'] nor $first_field['#bundle']. At this point (line 339), $first_child is not an array but my object entity (commerce_product).
No #bundle data, even in object but we can get information thanks to common core method like entity_extract_ids().
Fatal error occurs displaying or editing node :
Error : Cannot use object of type stdClass as array in display_cache_field_attach_view_alter() (ligne 340 display_cache/display_cache.module )
Follow a patch to use entity_extract_ids() to find bundle in case we deal with entity object.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | issue_getting_bundle-2832135-2.patch | 1002 bytes | goz |
Comments
Comment #2
goz commentedComment #3
mfernea commentedThe patch works well.