diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 66196ef..a518c13 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2316,7 +2316,6 @@ function template_preprocess_item_list(&$variables) { // Prepare for adding classes to each item. $num_items = count($variables['items']); $i = 0; - foreach ($variables['items'] as &$item) { $i++; $attributes = array(); @@ -2357,7 +2356,7 @@ function template_preprocess_item_list(&$variables) { } else { // Turn the item into an array if it wasn't one already. - $item = array('data' => $item); + $item = array('#markup' => $item); } // @todo remove after http://drupal.org/node/1649780 lands. diff --git a/core/modules/system/templates/item-list.html.twig b/core/modules/system/templates/item-list.html.twig index e635f3a..385140f 100644 --- a/core/modules/system/templates/item-list.html.twig +++ b/core/modules/system/templates/item-list.html.twig @@ -23,18 +23,21 @@ * @see http://drupal.org/node/1842140 To remove heading tag and div */ #} -{% if items %} - {% spaceless %} -
- {% if title is not empty -%} -

{{ title }}

- {%- endif %} - <{{ tag }}{{ attributes }}> - {% for item in items -%} - {% set value = item.data ? item.data : item -%} - {{ value }} - {%- endfor -%} - -
- {% endspaceless %} +{% if items is not empty %} +{% spaceless %} +
+ {% if title is not empty -%} +

{{ title }}

+ {%- endif %} + <{{ tag }}{{ attributes }}> + {% for item in items -%} + {# + We usually don't do this, but here we target a specific render element + property--#wrapper_attributes. + #} + {{ item }} + {%- endfor -%} + +
+{% endspaceless %} {% endif %}