Should #array_parents be updated to include fieldgroup parent/s when field_group_fields_nest() is called? I've created a patch which prepends #array_parents with group parent/s for any child element of a fieldgroup. Updates the base element and any element children (recursively) - eg. $element[$language], $element[$language][0], etc.

Comments

bgilhome’s picture

Status: Needs review » Needs work

The last submitted patch, 1: field_group-update_array_parents-2494385-1.patch, failed testing.

bgilhome’s picture

Updated patch to fix 'references to elements of a temporary array error. Also updates #field_parents where appropriate.

bgilhome’s picture

I must have diff'ed from the wrong commit, attached updated patch = diff from 7.x-1.x head.

bgilhome’s picture

Status: Needs work » Needs review

The last submitted patch, 3: field_group-update_array_parents-2494385-2.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: field_group-update_array_parents-2494385-3.patch, failed testing.

bgilhome’s picture

Modified patch to not prepend group parents if they already exist in #array_parents/#field_parents. Also fix 'unset index' notices.

bgilhome’s picture

Status: Needs work » Needs review
milos.kroulik’s picture

The patch from #8 doesn't apply to the latest version:

$ git apply field_group-update_array_parents-2494385-8.patch
error: patch failed: field_group.info:5
error: field_group.info: patch does not apply
error: patch failed: field_group.module:2239
error: field_group.module: patch does not apply
jproctor’s picture

@milos.kroulik, the patch from #8 doesn't apply to 1.4 because it was built on 1.x-dev, which also includes the patch from #2386335. Adding a function to the end of the file is tricky, too. Also it unnecessarily touches the .info file, which invites trouble.

I've updated the patch here to remove the .info stuff and bring the new helper function up a little closer to coding standards (and moved it to be near where it's called), and have successfully applied it to version 1.4 after applying the patch in #2386335.

joelstein’s picture

Status: Needs review » Reviewed & tested by the community

Just want to point out that this patch works splendidly and is required for Conditional Fields to have Field Group support.

See #1161314-152: Add basic Field Group support for ANDing conditions.

  • zuuperman committed 388bb54 on 7.x-1.x authored by jproctor
    Issue #2494385 by bgilhome, jproctor: Should #array_parents be updated...
nils.destoop’s picture

Status: Reviewed & tested by the community » Fixed

Thx for the patch, pushed it to dev

Status: Fixed » Closed (fixed)

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

travelvc’s picture

Unfortunately it seems this patch causes tabs to be erroneously displayed in certain cases:

https://www.drupal.org/project/field_group/issues/2926605