Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#31583 closed defect (bug) (worksforme)

Translate or cut user_nicename

Reported by: moonkir's profile moonkir Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: Users Keywords: close
Focuses: administration Cc:

Description

1. Add new user:
login - any
first name - Ivan
last name - Ivanov
mail - any

1.1. View DataBase table wp_users
collumn user_nicename
before 4.1
user_nicename - Ivan Ivanov
after 4.1
user_nicename - i-ivanov

1.2. Search "Ivanov" in admin panels - users

"Ivanov" found


2. Add new user:
login - any
first name - Иван
last name - Иванов
mail - any

2.1. View DataBase table wp_users
collumn user_nicename
before 4.1
user_nicename - Иван Иванов
after 4.1
user_nicename - i-ivanov

2.2. Search "Иванов" in admin panels - users

"Иванов" not found

Search in cyrillic fails because the name in column user_nicename was translated

Search is apparently carried out on columns user_login and user_nicename in which no сyrillic in versions 4.1 later

I tested it`s in clean WP and DataBase. No plugins
from 3.8 to 4.1.1

Change History (5)

#1 follow-up: @morganestes
10 years ago

What language is the Admin UI set to when you're testing?

#2 in reply to: ↑ 1 @moonkir
10 years ago

Replying to morganestes:

What language is the Admin UI set to when you're testing?

RU and EN

#3 @DrewAPicture
10 years ago

  • Summary changed from Translate or cute user_nicename to Translate or cut user_nicename

#4 @SergeyBiryukov
10 years ago

  • Component changed from General to Users
  • Keywords close added

2.1. View DataBase table wp_users
collumn user_nicename
before 4.1
user_nicename - Иван Иванов
after 4.1
user_nicename - i-ivanov

I can't reproduce that. user_nicename is used in author archives URL and is based on a sanitized version of user_login, not on display_name.

user_login cannot contain Cyrillic characters by default, so user_nicename does not either.

Even with a plugin like Allow Cyrillic Usernames, user_nicename contains a URL-encoded username (%d0%b8%d0%b2%d0%b0%d0%bd-%d0%b8%d0%b2%d0%b0%d0%bd%), not raw Cyrillic.

[29819] is the only change in 4.1 that might be relevant here, but it does not affect core behavior. You probably have a plugin or a function changing the default user registration sequence somewhere on your install.

Search in cyrillic fails because the name in column user_nicename was translated

No, it fails because display_name is not included in the list of fields to search by default. It can be added with the user_search_columns filter:

function wp31583_add_display_name_to_user_search_columns( $search_columns ) {
	$search_columns[] = 'display_name';

	return $search_columns;
}
add_filter( 'user_search_columns', 'wp31583_add_display_name_to_user_search_columns' );

#5 @wonderboymusic
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.