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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hadsie’s picture

FileSize
417 bytes
hadsie’s picture

Status: Needs review » Closed (works as designed)

Actually, 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.

pmackay’s picture

Did 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.

akalata’s picture

heddn’s picture

Status: Closed (works as designed) » Needs review
FileSize
1.78 KB

While 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

Status: Needs review » Needs work

The last submitted patch, field_group-notice-uninitialized-1596304-5.patch, failed testing.

Stalski’s picture

Status: Needs work » Closed (fixed)

This 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.

heddn’s picture

Status: Closed (fixed) » Needs review
FileSize
1.82 KB

In 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.

heddn’s picture

Status: Needs review » Closed (fixed)

Note to self: I really need to look at dev code branch a little more. This is definitely resolved now. Ignore #8.