From dd7b6c7ee7379347e7b1a58b080424b82e8b9987 Mon Sep 17 00:00:00 2001 From: hatuhay <alberto@siles.pe> Date: Mon, 6 Mar 2017 18:36:44 -0500 Subject: [PATCH] Issue #2668298: Custom Search Module Conflict. --- bootstrap_barrio.theme | 5 ++++- templates/form/form-element.html.twig | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bootstrap_barrio.theme b/bootstrap_barrio.theme index ef2b73e..a19c85a 100644 --- a/bootstrap_barrio.theme +++ b/bootstrap_barrio.theme @@ -332,9 +332,12 @@ function bootstrap_barrio_preprocess_block(&$variables) { } function bootstrap_barrio_preprocess_form_element(&$variables) { - if (is_object($variables['label']['#title'])) { + if ( is_object($variables['label']['#title']) ) { $variables['input_title'] = $variables['label']['#title']->render(); } + else { + $variables['input_title'] = $variables['label']['#title']; + } $variables['input_attributes'] = new Attribute($variables['element']['#attributes']); } diff --git a/templates/form/form-element.html.twig b/templates/form/form-element.html.twig index 75d79ba..84e39bc 100644 --- a/templates/form/form-element.html.twig +++ b/templates/form/form-element.html.twig @@ -50,6 +50,7 @@ 'js-form-item', 'js-form-type-' ~ type|clean_class, type in ['checkbox', 'radio'] ? type|clean_class : 'form-type-' ~ type|clean_class, + type in ['checkbox', 'radio'] ? form-check, 'js-form-item-' ~ name|clean_class, 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', @@ -74,11 +75,11 @@ {{ description.content }} </div> {% endif %} - <label> + <label class="form-check-label"> {% if label_display == 'before' %} {{ input_title }} {% endif %} - <input{{ input_attributes }}> + <input{{ input_attributes.addClass('form-check-input') }}> {% if label_display == 'after' %} {{ input_title }} {% endif %} @@ -97,7 +98,7 @@ </small> {% endif %} </div> - {% else %} +{% else %} <fieldset{{ attributes.addClass(classes, 'form-group') }}> {% if label_display in ['before', 'invisible'] %} {{ label }} -- GitLab