Commit fc502fb1 authored by webchick's avatar webchick

Issue #1893400 follow-up by sun: Switch autocomplete widget to type hidden,...

Issue #1893400 follow-up by sun: Switch autocomplete widget to type hidden, input false for more optimal fix.
parent 1de4821b
......@@ -4095,19 +4095,17 @@ function form_process_autocomplete($element, &$form_state) {
$element['#attributes']['class'][] = 'form-autocomplete';
$element['#attached']['library'][] = array('system', 'drupal.autocomplete');
// Provide a hidden element for the JavaScript behavior to bind to. Since
// this element is for client-side functionality only, and we don't want to
// collect any input from it, use #theme = 'input__hidden' and #pre_render =
// 'form_pre_render_hidden' instead of #type='hidden'.
// this element is for client-side functionality only, do not process input.
// @todo Refactor autocomplete.js to accept Drupal.settings instead of
// requiring extraneous markup.
$element['autocomplete'] = array(
'#theme' => 'input__hidden',
'#pre_render' => array('form_pre_render_hidden'),
'#type' => 'hidden',
'#input' => FALSE,
'#id' => $element['#id'] . '-autocomplete',
'#value' => url($element['#autocomplete_path'], array('absolute' => TRUE)),
'#disabled' => TRUE,
'#attributes' => array(
'id' => $element['#id'] . '-autocomplete',
'value' => url($element['#autocomplete_path'], array('absolute' => TRUE)),
'class' => array('autocomplete'),
'disabled' => 'disabled',
),
);
}
......
Markdown is supported
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