Error from facets summary template
Closed this issue · 1 comments
msnassar commented
The facets summary item list template is rendering the "item" from "items" variable. But an item in items contains attributes and value:
User error: "attributes" is an invalid render array key in Drupal\Core\Render\Element::children() (line 97 of core/lib/Drupal/Core/Render/Element.php).
The change of the code has been done in:
e71e109#diff-b5965104207a0d4d96f4f2ec4206b64ddfa5329904504914b5abf74b90e31488R35
and also
37557e3#diff-b5965104207a0d4d96f4f2ec4206b64ddfa5329904504914b5abf74b90e31488L24
Here is the fix:
{#
/**
* @file
* Default theme implementation for a facets summary item list.
*
* Available variables:
* - items: A list of items. Each item contains:
* - attributes: HTML attributes to be applied to each list item.
* - value: The content of the list element.
* - title: The title of the list.
* - list_type: The tag for list element ("ul" or "ol").
* - wrapper_attributes: HTML attributes to be applied to the list wrapper.
* - attributes: HTML attributes to be applied to the list.
* - empty: A message to display when there are no items. Allowed value is a
* string or render array.
* - context: A list of contextual data associated with the list. May contain:
* - list_style: The custom list style.
*
* @see facets_summary_preprocess_facets_summary_item_list()
*
* @ingroup themeable
*/
#}
{%- if items -%}
{%- for item in items -%}
{{ item.value }}
{%- endfor -%}
{%- else -%}
{{- empty -}}
{%- endif -%}
drishu commented
fixed