Problem/Motivation

Nested field_group have not access to the parent settings. So each time we have to set manually the setting to the child/nested fieldgroup.

  • [field_group] Pattern A
    • Setting SA1
      • [field] field_fa1
      • [field_group] Pattern B
        • Setting SA1
        • Setting SB1
        • [field] field_b1
        • [field] field_b2

Steps to reproduce

Create 1 nested field_group and see if parent settings are accessible.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

julien tekrane created an issue. See original summary.

julien tekrane’s picture

Status: Active » Needs review
pdureau’s picture

Assigned: Unassigned » duaelfr

Edouard, do you want to have a look?

duaelfr’s picture

Assigned: duaelfr » Unassigned
Status: Needs review » Postponed (maintainer needs more info)

@julien tekrane: I don't get your need here. Your code overwrites the child field group settings by the parent ones. I'm quite sure this is not a behavior we want by default. Could you elaborate a bit on what you are trying to achieve here? Maybe give a specific example.

julien tekrane’s picture

@duaelfr
For example you have a Pattern Accordion🟦, and a Pattern Accordion item🔷.

🟦Parent (Accordion patern)
- Setting1 : "valueParent"
🔷child item 1 (Accordion_item pattern)
- Setting1 : empty, so the value is "valueParent"
🔷child item 2 (Accordion_item pattern)
- Setting1 : "valueChild2", so the value is "valueChild2"

I want to only set a setting in the parent field_group using Accordion🟦 and this setting will be get by child field_group items🔷. Of course the setting have to be declared in the accordion_item.ui_patterns.yml file. If it is set in a child item 🔷, it overrides the parent🟦 setting.

pdureau’s picture

Assigned: Unassigned » duaelfr
Status: Postponed (maintainer needs more info) » Active
duaelfr’s picture

Assigned: duaelfr » Unassigned
Category: Task » Feature request

@julien tekrane: just to be sure I understand, are we talking about settings as in "ui_patterns_settings" (ie. defined in the pattern) or settings as in field_group settings (ie. group label, group shown when empty, etc.)?

I both case, I'm not sure we want that inheritance to be the default behavior, so *if* it was to be implemented, it should be opt-in.

@pdureau What do you think about this? I believe this kind of inheritance never existed and still don't exist in 2.x, is it?

julien tekrane’s picture

@duaelfr: I am talking about "ui_patterns_settings" (ie. defined in the .ui_patterns.yml).