I created an Accordion group (group_main), and a lot of children (as Accordion Items). When I delete a child group from the content type, then it is not removed from the group_main. If I programmatically walk through on all child of group_main in hook_form_alter (foreach $form['#groups']['group_main']['children']) then I found the deleted item, which causes an undefined index in the code, because $form['#groups']['the_deleted_item'] is not exists. You can see on the attached picture, the group_about is not exists (deleted), but group_main contains this item yet. It is not deleted from the field_group table, and from the corresponding record in the variables table (default_field_group variable).
| Comment | File | Size | Author |
|---|---|---|---|
| field_group_bug.png | 111.82 KB | zoltán balogh |
Comments
Comment #1
nils.destoop commentedCan you check if this still occurs in latest dev?
that the group still exists as a child is normal. When fieldgroup is preparing everything. There is a check if the child is set.
Comment #2
nils.destoop commentedComment #2.0
nils.destoop commentedMistyped text.
Comment #3
krystalcode commentedI have come across the same issue. I have created a multipage group, created a few pages, and then I removed the last page. The removed page does not exist as a group, but exists as a child of the multipage group.
This has caused problems in 2 ways. I want to easily get the count of the pages, and count($group['children']) is wrong. I also work with the 'field_group_ajaxified_multipage' module, and there are 'unknown index' errors. It probably uses information from the $group['children'] array, and rightfully expects it to be accurate.
What do you mean when saying "that the group still exists as a child is normal"? When permanently delete a field group should I not expect that it is really gone?
I can submit a patch if you point out where to look at.
Comment #4
krystalcode commentedRe-saving the settings for the parent multipage group seems to fix the issue. It might still be worth fixing this because it can cause confusion when used by non-technical users, such as when creating surveys using entityform etc.
Comment #5
nils.destoop commented