Have:
Accordion group (fieldgroup)
-Accordion item 1 (fieldgroup)
--Some field

Items are showing, but no accordion functionality. JS or CSS fails

Comments

Håvard’s picture

Same problem!

willowdigit’s picture

I have the same problem. I know the issue has to do with the id that is not set on the $element. The anchor tag does not have the proper fragment identifier on it (as there is no id to build it from), and then the content div does not have the id attribute that the anchor fragment references. Hence jQuery UI cannot function properly.

I have a shoddy workaround as I cannot trace where the id is supposed to be set. (It is not the id that is set on the gear popup form for the accordion group. That id is for the outer container.)

This is what I do in bootstrap_fieldgroup.module:

function field_group_pre_render_bootstrap_accordion_item(&$element, $group, &$form) {
$element['#id'] = drupal_html_id('bs-accord-' . rand(0, 9999)); // add this line

Håvard’s picture

@ WillowDigit

Thanks, works for me :)

irowboat’s picture

Thank you WillowDigit, got it working also with your help.

socialnicheguru’s picture

the fix in 2 is not working for me

openjuy’s picture

works but I get this error
Notice: Undefined index: #id en field_group_pre_render_bootstrap_accordion() (línea 171 de /home/seba/www/scholarly/sites/all/modules/bootstrap_fieldgroup/bootstrap_fieldgroup.module).

ckng’s picture