Commit a26dc750 authored by Martin Keereman's avatar Martin Keereman
Browse files

Issue #3106389 by Etroid, ibullock: Fieldset and wrapper div have same ID

parent 1d4b5fea
......@@ -7,6 +7,7 @@
use Drupal\Component\Utility\Html;
use Drupal\Core\Render\Element;
use Drupal\Core\Template\Attribute;
/**
* Implements hook_theme().
......@@ -88,6 +89,10 @@ function better_exposed_filters_preprocess_views_exposed_form(array &$variables)
function template_preprocess_bef_checkboxes(array &$variables) {
$element = &$variables['element'];
// Create new wrapper attributes since the element attributes will be used
// on the fieldset (@see template_preprocess_fieldset).
$variables['wrapper_attributes'] = new Attribute();
$variables['children'] = Element::children($element);
$variables['show_select_all_none'] = $element['#bef_select_all_none'] ?? FALSE;
$variables['show_select_all_none_nested'] = $element['#bef_select_all_none_nested'] ?? FALSE;
......@@ -114,6 +119,10 @@ function template_preprocess_bef_checkboxes(array &$variables) {
function template_preprocess_bef_radios(array &$variables) {
$element = &$variables['element'];
// Create new wrapper attributes since the element attributes will be used
// on the fieldset (@see template_preprocess_fieldset).
$variables['wrapper_attributes'] = new Attribute();
$variables['children'] = Element::children($element);
$variables['display_inline'] = $element['#bef_display_inline'] ?? FALSE;
......
......@@ -2,6 +2,7 @@
Themes Views' default multi-select element as a set of checkboxes.
Available variables:
- wrapper_attributes: attributes for the wrapper element.
- element: The collection of checkboxes.
- children: An array of keys for the children of element.
- is_nested: TRUE if this is to be rendered as a nested list.
......@@ -16,7 +17,7 @@
show_select_all_none_nested ? 'bef-select-all-none-nested',
display_inline ? 'form--inline'
] %}
<div{{ attributes.addClass(classes) }}>
<div{{ wrapper_attributes.addClass(classes) }}>
{% set current_nesting_level = 0 %}
{% for child in children %}
{% set item = attribute(element, child) %}
......
......@@ -2,6 +2,7 @@
Themes a single-select exposed form element as radio buttons.
Available variables:
- wrapper_attributes: attributes for the wrapper element.
- element: The collection of checkboxes.
- children: An array of keys for the children of element.
- is_nested: TRUE if this is to be rendered as a nested list.
......@@ -16,7 +17,7 @@
display_inline ? 'form--inline'
]
%}
<div{{ attributes.addClass(classes) }}>
<div{{ wrapper_attributes.addClass(classes) }}>
{% set current_nesting_level = 0 %}
{% for child in children %}
{% set item = attribute(element, child) %}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment