Loading bootstrap_barrio.theme +16 −4 Original line number Diff line number Diff line Loading @@ -655,21 +655,33 @@ function bootstrap_barrio_theme_suggestions_input_alter(array &$suggestions, arr */ /** * Implements hook_preprocess_input() for adding classes to inputs. * Implements hook_preprocess(). */ function bootstrap_barrio_preprocess_input(&$variables) { function bootstrap_barrio_preprocess(&$variables, $hook) { if (isset($variables['attributes']['class'])) { $class = 'is-invalid'; if (is_object($variables['attributes']['class'])) { if (in_array('error', $variables['attributes']['class']->value())) { $variables['attributes']['class']->addClass('is-invalid'); $variables['attributes']->addClass($class); // If there is a wrapper, add class too. if (isset($variables["wrapper_attributes"])) { $variables['wrapper_attributes']->addClass($class); } } } elseif (is_array($variables['attributes']['class'])) { if (in_array('error', $variables['attributes']['class'])) { $variables['attributes']['class'][] = 'is-invalid'; $variables['attributes']['class'][] = $class; } } } } /** * Implements hook_preprocess_input() for adding classes to inputs. */ function bootstrap_barrio_preprocess_input(&$variables) { if ($variables['element']['#type'] == 'submit') { $button_size = theme_get_setting('bootstrap_barrio_button_size'); $button_types = [ Loading Loading
bootstrap_barrio.theme +16 −4 Original line number Diff line number Diff line Loading @@ -655,21 +655,33 @@ function bootstrap_barrio_theme_suggestions_input_alter(array &$suggestions, arr */ /** * Implements hook_preprocess_input() for adding classes to inputs. * Implements hook_preprocess(). */ function bootstrap_barrio_preprocess_input(&$variables) { function bootstrap_barrio_preprocess(&$variables, $hook) { if (isset($variables['attributes']['class'])) { $class = 'is-invalid'; if (is_object($variables['attributes']['class'])) { if (in_array('error', $variables['attributes']['class']->value())) { $variables['attributes']['class']->addClass('is-invalid'); $variables['attributes']->addClass($class); // If there is a wrapper, add class too. if (isset($variables["wrapper_attributes"])) { $variables['wrapper_attributes']->addClass($class); } } } elseif (is_array($variables['attributes']['class'])) { if (in_array('error', $variables['attributes']['class'])) { $variables['attributes']['class'][] = 'is-invalid'; $variables['attributes']['class'][] = $class; } } } } /** * Implements hook_preprocess_input() for adding classes to inputs. */ function bootstrap_barrio_preprocess_input(&$variables) { if ($variables['element']['#type'] == 'submit') { $button_size = theme_get_setting('bootstrap_barrio_button_size'); $button_types = [ Loading