Hello

When I create a view with a page display and I try to view it, I get errors coming from the field_group_attach_groups function in field_group.module. It's a simple view listing pages of a specific contenttype (title and image field).

* Notice: Undefined index: #entity_type in field_group_attach_groups() (line 905 of /sites/all/modules/contrib/field_group/field_group.module).
* Notice: Undefined index: #bundle in field_group_attach_groups() (line 906 of /sites/all/modules/contrib/field_group/field_group.module).
* Notice: Trying to get property of non-object in field_group_attach_groups() (line 913 of /sites/all/modules/contrib/field_group/field_group.module).
* Warning: Invalid argument supplied for foreach() in field_group_attach_groups() (line 913 of /sites/all/modules/contrib/field_group/field_group.module).
* Notice: Undefined index: #entity_type in field_group_attach_groups() (line 905 of /sites/all/modules/contrib/field_group/field_group.module).
* Notice: Undefined index: #bundle in field_group_attach_groups() (line 906 of /sites/all/modules/contrib/field_group/field_group.module).
* Notice: Trying to get property of non-object in field_group_attach_groups() (line 913 of /sites/all/modules/contrib/field_group/field_group.module).
* Warning: Invalid argument supplied for foreach() in field_group_attach_groups() (line 913 of /sites/all/modules/contrib/field_group/field_group.module).

The problem seems to be that in this case, there is no "#entity_type" or "#bundle" available in the $element array.

I tried to use the $view_mode to see if I'm rendering a view, but the view mode is set to "default" so I can't use that.

So I took the easy way out and surrounded the code with this if statement:

if (isset($element['#entity_type']) && isset($element['#bundle'])) {
  //snip
}

This is probably not the way to go, but at least it's in the issue queue now :)

Oz

Comments

Stalski’s picture

Status: Active » Closed (fixed)

Fixed in dev. thx for the report