- 
                Notifications
    You must be signed in to change notification settings 
- Fork 55
Issue #194: Support Fieldgroups. #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 8.x-1.x
Are you sure you want to change the base?
Conversation
| Please note that this implementation is inspired on the one in the PR #137 . | 
| What is happening in the output is that when we are in \Drupal\ui_patterns_field_group\Plugin\field_group\FieldGroupFormatter\PatternFormatter::preRender() If the field is a fieldgroup using a pattern, #type, #id, #fields and #multiple_sources are not injected since there is no expectation to fetch those values. | 
| This version of the PR starts to output content using the configured pattern. | 
| Here we are! We are now able to have pattern fieldgroups within pattern fieldgroups (within pattern fieldgroups, within... you get it! ;)). There is one improvement that could be made (at least) which is related to the fieldgroup config. I'm not sure that its doable but, within a fieldgroup, when we check the settings of the child fieldgroups, we have to load it from the EntityViewDisplay config file. If the user is modifying some settings (changing a target region for a field for instance), this setting may be inaccurate (but i'm not 100% sure). | 
| While testing this I had a really strange issue. I have a field group "parent" that contains fields and another field group "child". It looks like the following. 
 It's working well except that all the content of the field of the "child" field group is duplicated. If I export the configuration, "parent" is defined before "child" in the YML. If I invert the two definitions then import config back to the database. The issue is fixed. | 
| Wow, nice one! Could you please enable "Allowing changes to a pull request branch created from a fork" so I can push directly to your fork and work on the PR? | 
| Normally you have this permission. It doesn't work? | 
| Nope, I get a permission denied when trying to push to your repo's 8.x-1.x branch, but ok, it's not necessary, I was just curious to see how that would work! 😄 | 
| I gave you push access to the whole repo, it should do it this time. | 
This is a first version for the issue #194 to support Fieldgroups.
It displays the list of fieldgroups in the pattern config associated with a field group.
There is still an issue in the output as is. If you have a parent fieldgroup that is rendered with a pattern, within is rendered another fieldgroup which is itself a pattern. When the child fieldgroup is rendered, its fields are correctly display but the selected pattern template is not rendered.