Motivation
TypeError: reset(): Argument #1 ($array) must be of type array, string given in reset() (line 162 of modules/contrib/ui_patterns/src/Element/Pattern.php).
Drupal\ui_patterns\Element\Pattern::processMultipleSources()
Steps to reproduce
Set a display with Pattern A that renders only a child field_group Pattern B. No fields in Pattern A, only in Pattern B.
- [field_group] Pattern A
- [field_group] Pattern B
- [field] field_b1
- [field] field_b2
Proposed resolution
No output if no fields. Let the rendering responsability to the child field_group.
Issue fork ui_patterns-3530141
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
Comment #3
julien tekrane commentedComment #4
pdureau commentedComment #6
duaelfr@julien tekrane:
Hi!
Thank you for bringing this back. I recognize a big part of your code as my own code from an old PR on github.
I have been using this for a very long time but it seem that it is not needed anymore to get nested groups working.
I removed this patch on all my projects without any difference. I guess that's because some "recent" changes in Field Group.
I just pushed a tiny change in our field group formatter to ensure that
field_group_remove_empty_display_groups()has what it needs to handle our groups. That should fix the last use cases with nested groups.Do you still have issues? Can you provide steps to reproduce on a clean install?
Comment #7
julien tekrane commented@duaelfr
I updated with 8.x-1.13 version and still have the issue.
Here is my use case (each point is a pattern) :
I certainly too much played with _items in my theme/templates/patterns/accordion/pattern-accordion--field-group.html.twig but have no other choice for providing by default
I have reverted previous commit and suggest a simpler approach. Please review it. Thanks
Comment #8
duaelfr@julien tekrane Would you provide me your patterns in an attached zip file so I can try to reproduce locally?
Comment #9
duaelfrSpring cleanup!
Feel free to reopen if needed ;)