With commit (https://www.drupal.org/commitlog/commit/51916/39be3ee14fa0316b8a5f0673cc...), I'm getting lots of these errors with the accordion option. The code is using $element['#id'], but that does not exist and the accordion doesn't actually function. If I change $element['#id'] to $group->id, everything seems to work OK.

Errors:

Notice: Undefined index: #id in field_group_pre_render_bootstrap_accordion_item() (line 195 of /var/www/drupal/sites/default/modules/contrib/bootstrap_fieldgroup/bootstrap_fieldgroup.module).
Notice: Undefined index: #view_mode in field_group_pre_render_bootstrap_accordion_item() (line 191 of /var/www/drupal/sites/default/modules/contrib/bootstrap_fieldgroup/bootstrap_fieldgroup.module).

Comments

davemybes’s picture

StatusFileSize
new1.67 KB

Patch attached. Use "patch -p0 < [filename]".

ckng’s picture

Issue summary: View changes
StatusFileSize
new2.22 KB

Patch #1 not quite working also the parent id is not unique enough. The fix also misses another PHP notice in the same function.

Attached patch reuse the unique identifier from fieldgroup as the id and fixed accordion functionality.

ckng’s picture

Status: Active » Needs review
cha0s’s picture

Status: Needs review » Closed (fixed)

I took a different approach on this, I didn't like the way accordion was written (I sorta just applied a patch a while back and didn't really give it the love it deserved), now accordion will have its own theme item and this and other stuff will be handled much differently.

It's in master, I haven't made a new release yet.

NOTE: The underlying reason for this issue is using a regular field under accordion, instead of under an accordion item fieldgroup. The latest version removes that requirement (as it is for navs)

cha0s’s picture

Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.