What are the steps required to reproduce the bug?
Give focus to field that supports Drupal powered auto-complete from previous entries. Press up/down as if you were selecting a suggestion even though there isn't one as you haven't typed anything.

Tab to the next field without typing anything in to the field.

What behavior were you expecting?
Field should be left empty as we haven't selected a suggestion.

What happened instead?
'undefined' is printed in to the field. Clearly the field is being monitored for up/down keypresses. If there are no suggestions shown the auto-complete variable should not be assigned.

Mac OS X 10.4.10. PHP version 5.2.3, Drupal version 5.2.

I haven't thoroughly tested this bug. Just thought I'd flag it as an issue although I doubt it's Safari v3.0.3 specific.

Comments

jamesconroyfinn’s picture

This bug only occurs when pressing down, not up.

nedjo’s picture

Title: Autocomplete behaviour » Autocomplete triggered when switching fields, 'undefined' written to field
Status: Needs review » Active

Improving title, no patch so setting to active.

mlncn’s picture

Confirmed cross-browser (previously documented on Agaric's site). This is a significant bug, it doesn't just appear when you type nothing-- it will also replace everything you've typed with 'undefined'.

To reproduce:

  1. Enable a free tagging vocabulary and edit a node that has it.
  2. Type Many, test, sites, carmisof in the free tagging vocabulary field.
  3. Press the down arrow.
  4. Press tab.

Everything you have typed is replaced with undefined.

nielsvm’s picture

Component: taxonomy.module » other

Confirmed in Opera and Konqueror...

mlncn’s picture

Version: 5.2 » 5.x-dev
Component: other » taxonomy.module

I think this still belongs to taxonomy.module still.

LAsan’s picture

Any news on this issue?

mrcalc’s picture

The above bug could be fixed in Drupal 5 by adding the following code to the beginning of Drupal.jsAC.prototype.selectDown in misc/autocomplete.js

if (this.popup == null) {
return false;
}

Can anyone comment on whether this could cause any other problems with autocomplete?

c960657’s picture

Version: 5.x-dev » 7.x-dev
Component: taxonomy.module » javascript
Status: Active » Needs review
StatusFileSize
new786 bytes

This bug also exists in D6 and D7. I have seen this occasionally but couldn't find a way to reproduce it, but it really is a simple as described in this issue.

casey’s picture

Status: Needs review » Reviewed & tested by the community

Tested and working. Simple and effective.

klausi’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new441 bytes

Changed "else if" to "elseif" (coding standards)

c960657’s picture

Status: Needs review » Reviewed & tested by the community

elseif does not exist in JavaScript. Setting the patch in #8 back to RTBC.

klausi’s picture

Hm ok, fixed the javascript coding standards docs at http://drupal.org/node/172169

klausi’s picture

#8: autocomplete-undefined-1.patch queued for re-testing.

aspilicious’s picture

Just to remind Dries or Webchick: add patch in #8 NOT #10 :)

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed #8 to CVS HEAD. Thanks.

c960657’s picture

Status: Fixed » Needs review
StatusFileSize
new784 bytes

D6 backport.

c960657’s picture

Version: 7.x-dev » 6.x-dev

Status: Needs review » Needs work

The last submitted patch, autocomplete-undefined-D6-1.patch, failed testing.

c960657’s picture

Status: Needs work » Needs review

#16: autocomplete-undefined-D6-1.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, autocomplete-undefined-D6-1.patch, failed testing.

c960657’s picture

Status: Needs work » Needs review

#16: autocomplete-undefined-D6-1.patch queued for re-testing.

c960657’s picture

StatusFileSize
new450 bytes

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.