diff --git a/core/includes/form.inc b/core/includes/form.inc index ce5779c..7222058 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -2167,33 +2167,18 @@ function form_process_autocomplete($element, &$form_state) { } /** - * Preprocesses variables for theme_input(). + * Prepares variables for input templates. * - * @param array $variables - * An associative array containing: - * - element: An associative array containing the properties of the element. - * - * @ingroup themeable - */ -function template_preprocess_input(&$variables) { - $element = $variables['element']; - $variables['attributes'] = new Attribute($element['#attributes']); -} - -/** - * Returns HTML for an input form element. + * Default template: input.html.twig. * * @param array $variables * An associative array containing: * - element: An associative array containing the properties of the element. * Properties used: #attributes. - * - * @ingroup themeable */ -function theme_input($variables) { +function template_preprocess_input(&$variables) { $element = $variables['element']; - $attributes = $variables['attributes']; - return '' . drupal_render_children($element); + $variables['children'] = $element['#children']; } /** diff --git a/core/includes/theme.inc b/core/includes/theme.inc index f98aadd..2853de1 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2666,6 +2666,7 @@ function drupal_common_theme() { // From form.inc. 'input' => array( 'render element' => 'element', + 'template' => 'input', ), 'select' => array( 'render element' => 'element', diff --git a/core/modules/system/templates/input.html.twig b/core/modules/system/templates/input.html.twig new file mode 100644 index 0000000..9b2522c --- /dev/null +++ b/core/modules/system/templates/input.html.twig @@ -0,0 +1,15 @@ +{# +/** + * @file + * Default theme implementation for an 'input' #type form element. + * + * Available variables + * - attributes: A list of HTML attributes for the input element. + * - children: The rendered input. + * + * @see template_preprocess_input() + * + * @ingroup themeable + */ +#} +{{ children }}