Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For some reason I've started getting this notice when using field_group:
Notice: Uninitialized string offset: 0 in field_group_unpack() (line 1524 of /path/to/drupal/site/all/modules/contrib/field_group/field_group.module).
I have a feeling it was initially triggered when using commerce_fieldgroup_panes module in combination with features, but I haven't been able to track down the source of the issue. However, changing isset() to !empty() in field_group_unpack() seems to fix the notices for me. The attached patch makes that update.
Comment | File | Size | Author |
---|---|---|---|
#8 | field_group-notice-uninitialized-1596304-8.patch | 1.82 KB | heddn |
#5 | field_group-notice-uninitialized-1596304-5.patch | 1.78 KB | heddn |
#1 | field_group-1596304.patch | 417 bytes | hadsie |
Comments
Comment #1
hadsie CreditAttribution: hadsie commentedComment #2
hadsie CreditAttribution: hadsie commentedActually, nevermind.. it seems like something more sinister is going on here. Going to delete all my field groups and recreate them to try and fix this.
Comment #3
pmackay CreditAttribution: pmackay commentedDid you find out any more info on what was going on here? Just experienced the same issue in a similar scenario of importing commerce types using Features.
Comment #4
akalata CreditAttribution: akalata commentedreposted at #2065081: Causes errors with Field Group in Features?
Comment #5
heddnWhile I think that other modules might create the issue i.e. remove all the children of the field group, this can also happen manually i.e. someone doesn't assign fields to a group. This patch should catch the issue by providing default values if the group data is empty
Comment #7
Stalski CreditAttribution: Stalski commentedThis issue is a bit outdated. The patch in #1 is redundant since the code changed a lot since then.
The patch in #5 is another issue imo. The problem for the isset/empty check has been changed and solves the problem defined ni the issue.
I can't seem to understand what you mean by not assigning fields to a group and the resulting problem. If this is a problem, please open a new issue and some steps to reproduce it.
Comment #8
heddnIn this client's site, they have an empty field_group with no children. Not sure why.
I seemed to have missed the clone in the patch when merging the patch from the latest stable build (which was what I was working against). Let's see if this makes the test bot a little more happy.
Comment #9
heddnNote to self: I really need to look at dev code branch a little more. This is definitely resolved now. Ignore #8.