Skip to:

Opened 11 years ago

Closed 11 years ago

#4779 closed defect (bug) (fixed)

messge compose autocompletefb.js splitting user name wrongly

Reported by: mort3n's profile mort3n Owned by: boonebgorges's profile boonebgorges
Milestone: 1.8 Priority: normal
Severity: normal Version: 1.6.1
Component: Messages Keywords: has-patch needs-testing




the user should be removed by

removeUsername: function(o){
var newID ='-');

The id being split contains the string 'un-user_name'. The code works great when 'user_name' contains no '-'. However, with

user_name = 'john-doe'

the code tries to remove class


which fails.
Using a


seems to be valid in user names

A fix is

removeUsername: function(o){
var newID =;

Another fix is

removeUsername: function(o){
var newID ='-'));

Change History (2)

#1 @boonebgorges
11 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 1.8

Good catch. Ideally I'd like to see us stop using jquery.autocompletefb.js and use something that comes with WP (or is at least not crummy); see #4580. However, this seems like a straightforward fix if we keep the fb version for a few more releases.

#2 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 6928:

Improve JS for removing items from message recipient autocomplete list

This changeset introduces a more reliable method for removing usernames from
the list of message recipients, which works properly with usernames that
contain hyphens.

Fixes #4779

Props mort3n

Note: See TracTickets for help on using tickets.