commit 067713c6e8fa5e87f5d55cb1717ec024aebde097 Author: Joel Pittet Date: Thu Feb 12 18:49:45 2015 -0800 fix diff --git a/core/modules/views/templates/views-view-fields.html.twig b/core/modules/views/templates/views-view-fields.html.twig index 785dc4e..a3a639d 100644 --- a/core/modules/views/templates/views-view-fields.html.twig +++ b/core/modules/views/templates/views-view-fields.html.twig @@ -28,25 +28,13 @@ */ #} {% for field in fields %} - {% spaceless %} - {{ field.separator }} - {% if field.wrapper_element %} - <{{ field.wrapper_element }} {{ field.wrapper_attributes }}> - {% endif %} - {% if field.label %} - {% if field.label_element %} - <{{ field.label_element }} {{ field.label_attributes }}>{{ field.label }}{{ field.label_suffix }} - {% else %} - {{ field.label }}{{ field.label_suffix }} - {% endif %} - {% endif %} - {% if field.element_type %} - <{{ field.element_type }} {{ field.element_attributes }}>{{ field.content }} - {% else %} - {{ field.content }} - {% endif %} - {% if field.wrapper_element %} - - {% endif %} - {% endspaceless %} + {{ field.separator }} + {{ field.wrapper_element ? '<' ~ field.wrapper_element ~ field.wrapper_attributes ~ '>' }} + {{ field.label_element ? '<' ~ field.label_element ~ field.label_attributes ~ '>' }} + {{ field.label }}{{ field.label_suffix }} + {{ field.label_element ? '' }} + {{ field.element_type ? '<' ~ field.element_type ~ field.element_attributes ~ '>' }} + {{ field.content }} + {{ field.element_type ? '' }} + {{ field.wrapper_element ? '' }} {% endfor %} diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 673a699..54eefcf 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -102,8 +102,8 @@ function template_preprocess_views_view_fields(&$variables) { if ($classes = $object->handler->elementClasses($row->index)) { $attributes['class'][] = $classes; } - $attributes = new Attribute($attributes); - $object->element_attributes = $attributes; + + $object->element_attributes = new Attribute($attributes); } $object->content = $field_output; @@ -139,8 +139,7 @@ function template_preprocess_views_view_fields(&$variables) { $attributes['class'][] = $classes; } - $attributes = new Attribute($attributes); - $object->wrapper_attributes = $attributes; + $object->wrapper_attributes = new Attribute($attributes); } // Set up field label. @@ -163,12 +162,12 @@ function template_preprocess_views_view_fields(&$variables) { $attributes['class'][] = 'views-label'; $attributes['class'][] = 'views-label-' . $object->class; } + $element_label_class = $object->handler->elementLabelClasses($row->index); if ($element_label_class) { $attributes['class'][] = $element_label_class; } - $attributes = new Attribute($attributes); - $object->label_attributes = $attributes; + $object->label_attributes = new Attribute($attributes); } }