- Issue created by @pdureau
- π«π·France pdureau Paris
Also, in collection_item component, this:
{% set is_list = meta_items_list is iterable and meta_items_list|keys|first == 0 %} {% set is_children = meta_items_list is iterable and meta_items_list|keys|first|first != "#" %} {% set meta_items_list = is_list or is_children ? meta_items_list : [meta_items_list] %}
can be replaced by:
{% set meta_items_list = meta_items_list is sequence ? meta_items_list : [meta_items_list] %}
And this:
{% set is_list = meta_items_tags is iterable and meta_items_tags|keys|first == 0 %} {% set is_children = meta_items_tags is iterable and meta_items_tags|keys|first|first != "#" %} {% set meta_items_tags = is_list or is_children ? meta_items_tags : [meta_items_tags] %}
By:
{% set meta_items_tags = meta_items_tags is sequence ? meta_items_tags : [meta_items_tags] %}
We lose a bit of logic here because we are supposing ALL mapping or renderables arrays. In UI Patterns 2, we are sure of that. In UI Patterns 1.x, I don't know.
- First commit to issue fork.
I tried replicating this. Drupal 11, set a view to display only article nodes. In row style option set to display body field using grid row component and plain text formatter. Everything worked as expected.
Possible to share more information about your view configuration that might explain the exception?
- First commit to issue fork.
- Merge request !85Issue #3484757: Use "is sequence" Twig test to prevent fatal errors when looping on slots β (Merged) created by smustgrave
- πΊπΈUnited States smustgrave
So for views there are actually view formatters for the view + style row that can be used
For example you can select the view to use "Accordion" component and pass the rows into the item slot
Then have each row use the "Accordion item" component and pass whatever fields to it.Pushed up a small MR with the changes, but haven't tested their previews yet.
-
smustgrave β
committed 3b0d7a5a on 4.0.x
Issue #3484757: Use "is sequence" Twig test to prevent fatal errors when...
-
smustgrave β
committed 3b0d7a5a on 4.0.x
Automatically closed - issue fixed for 2 weeks with no activity.