Just changing the original line:
'id' => $element['#id'],
with:
'id' => $group->id,
fixed the error for me.

Comments

thim’s picture

Hi Interdruper,

I have the same error but changing it didnt fixed it for me, any more ideas, that I can try-out?

Notice: Undefined property: stdClass::$id in field_group_pre_render_foundation_group_section_item() (line 150 of /www/sites/all/modules/contrib/foundation_group/foundation_group.module). Backtrace:
field_group_pre_render_foundation_group_section_item(Array, Object, Array) field_group.module:667
field_group_field_group_pre_render(Array, Object, Array) field_group.module:2047
field_group_pre_render(Array, Object, Array) field_group.module:2017
field_group_fields_nest(Array, Array) field_group.module:1908
field_group_build_entity_groups(Array, 'node') theme.inc:1122
theme('node', Array) common.inc:5903
drupal_render(Array) common.inc:5910
drupal_render(Array) common.inc:5910
drupal_render(Array) common.inc:5910
drupal_render(Array) common.inc:6004
render(Array) page.tpl.php:204
include('/www/sites/all/themes/polo/templates/page.tpl.php') theme.inc:1517
theme_render_template('sites/all/themes/polo/templates/page.tpl.php', Array) theme.inc:1201
theme('page', Array) common.inc:5903
drupal_render(Array) common.inc:5765
drupal_render_page(Array) common.inc:2674
drupal_deliver_html_page(Array) common.inc:2562
drupal_deliver_page(Array, '') menu.inc:532
menu_execute_active_handler() index.php:21
/**
 * Implements field_group_pre_render_<format-type>().
 */
function field_group_pre_render_foundation_group_section_item(&$element, $group, &$form) {
  // Convenience variables.
  $settings =& $group->format_settings['instance_settings'];
  $classes =& $settings['classes'];

  // Cast classes to array for easy manipulation and for adherence to
  // drupal_attributes() requirements.
  $classes = !empty($classes) ? explode(' ', $classes) : array();

  // Add required classes.
  $classes += array(
    'foundation-section-item',
  );

  // Strip duplicate classes.
  $classes = array_unique($classes);

  $element += array(
    '#type' => 'foundation_section_item',
    '#group' => $group->parent_name,
    '#title' => check_plain(t($group->label)),
    '#attributes' => array(
      'id' => $group->id,
    ),
    '#description' => $group->description,
    '#parents' => array($group->parent_name),
    '#formatter' => $group->format_settings['formatter'],
    '#settings' => $group->format_settings['instance_settings'],
  );
}
thim’s picture

Any news on this?

thim’s picture

I have created a patch for this issue.

Since there is not always an 'id' => $element['#id'],

I took the $group->name to have a proper ID tag available

ethanhinson’s picture

Changes in the field_group module's processing of html IDs has caused this issue to surface itself on a number of sites we maintain at Bluetent. To keep a mix of both legacy support, and changes being adopted in the field_group module. I'd like to propose the following patch. First, we'll make the ID configurable via the admin UI. Next, if no ID is set, use the format of entity_type-bundle-view_mode-group_name. Note that what would have been underscores previously, now adheres to the field_group pattern of using dashes.

ethanhinson’s picture

StatusFileSize
new1.64 KB

Added patch.

ethanhinson’s picture

StatusFileSize
new1.2 KB

Patch that applies against 7.x-2.3

ethanhinson’s picture

StatusFileSize
new1.26 KB

Rerolled against dev head.

kevinquillen’s picture

Hey Ethan, I went ahead and gave you commit access to this project. I'm juggling a bit at the moment and would take me some time to pivot around to this.