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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

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().

swentel’s picture

Status: Active » Needs review
FileSize
610 bytes

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.
dawehner’s picture

FileSize
675 bytes

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

dawehner’s picture

FileSize
1.12 KB

Adapted the documentation at the top.

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Works for me.

webchick’s picture

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

sun’s picture

Priority: Critical » Normal
Status: Fixed » Needs review
FileSize
1.46 KB

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

dawehner’s picture

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!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Much more betterer, thanks. :)

Committed and pushed to 8.x.

nod_’s picture

Priority: Normal » Critical
Status: Fixed » Needs review
FileSize
638 bytes

was broken. no id on input broke JS.

sun’s picture

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'.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

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

webchick’s picture

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.