Right now if you attempt to enter something into an autocomplete field (e.g. Tags), nothing happens.

This has come up in a few issues from people thinking they were somehow hallucinating. While I cannot attest to the recreational drug use among our contributor pools, I can confirm the same thing happens on my machine and I am stone-cold sober.

Files: 
CommentFileSizeAuthor
#10 core-autocomplete-1893400-10.patch638 bytesnod_
PASSED: [[SimpleTest]]: [MySQL] 50,853 pass(es).
[ View ]
#7 drupal8.form-autocomplete-hidden.7.patch1.46 KBsun
PASSED: [[SimpleTest]]: [MySQL] 50,698 pass(es).
[ View ]
#4 drupal-1893400-4.patch1.12 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 50,746 pass(es).
[ View ]
#3 drupal-1893400-3.patch675 bytesdawehner
PASSED: [[SimpleTest]]: [MySQL] 50,745 pass(es).
[ View ]
#2 1893400-2.patch610 bytesswentel
FAILED: [[SimpleTest]]: [MySQL] 50,492 pass(es), 64 fail(s), and 44 exception(s).
[ View ]

Comments

Been seeing this as well - you should also get 'Theme hook hidden not found' in your watchdog - I *think* this is related to #1812724: Consolidate all form element templates and add theme_hook_suggestons which removed theme_hidden().

Status:Active» Needs review
StatusFileSize
new610 bytes
FAILED: [[SimpleTest]]: [MySQL] 50,492 pass(es), 64 fail(s), and 44 exception(s).
[ View ]

So yeah, this fixes it ..

But there's a big todo in form_process_autocomplete(), not sure what todo with that

    // 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='hidden' instead of #type='hidden'.
    // @todo Refactor autocomplete.js to accept Drupal.settings instead of
    //   requiring extraneous markup.

StatusFileSize
new675 bytes
PASSED: [[SimpleTest]]: [MySQL] 50,745 pass(es).
[ View ]

I had the same fix on my system, though what about this?
It simulates what '#type' => 'hidden' does?

StatusFileSize
new1.12 KB
PASSED: [[SimpleTest]]: [MySQL] 50,746 pass(es).
[ View ]

Adapted the documentation at the top.

Status:Needs review» Reviewed & tested by the community

Works for me.

Status:Reviewed & tested by the community» Fixed

So of the two, #2 definitely looks better to me, but it fails tests. #4 though does what theme_hidden() used to be doing before it was removed, so it's the more proper fix. But we might want to look into that later, because I'm not sure anyone in the universe (other than the fabulous dawehner, of course :D) would know to set both + '#theme' => 'input__hidden', and + '#pre_render' => array('form_pre_render_hidden'),

Committed and pushed to 8.x. YAY! Thanks. :D

Priority:Critical» Normal
Status:Fixed» Needs review
StatusFileSize
new1.46 KB
PASSED: [[SimpleTest]]: [MySQL] 50,698 pass(es).
[ View ]

Let's use a regular element and the regular built-in facility to ignore user input and the value of a form element.

Status:Needs review» Reviewed & tested by the community

+++ b/core/includes/form.incundefined
@@ -4095,19 +4095,17 @@ function form_process_autocomplete($element, &$form_state) {
+      '#input' => FALSE,

oh cool!

Status:Reviewed & tested by the community» Fixed

Much more betterer, thanks. :)

Committed and pushed to 8.x.

Priority:Normal» Critical
Status:Fixed» Needs review
StatusFileSize
new638 bytes
PASSED: [[SimpleTest]]: [MySQL] 50,853 pass(es).
[ View ]

was broken. no id on input broke JS.

Oh. I'm sorry. Yes, #type hidden does not get an HTML ID by default, since no one usually needs to target those fields... so yeah, it needs to be in 'attributes'.

Status:Needs review» Reviewed & tested by the community

Yeah previous patch maybe needed a manual review ;)
It works now with the latest patch.

Status:Reviewed & tested by the community» Fixed

D'oh. :P

Committed and pushed to 8.x. Hopefully this is done for good now? :)

Automatically closed -- issue fixed for 2 weeks with no activity.