[wp-trac] [WordPress Trac] #60317: Cannot select an author from dropdown due to truncated users list

WordPress Trac noreply at wordpress.org
Wed Jan 24 02:00:39 UTC 2024


#60317: Cannot select an author from dropdown due to truncated users list
-------------------------------------------------+-------------------------
 Reporter:  yanksyoon                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  General                              |     Version:
 Severity:  major                                |  Resolution:
 Keywords:  needs-testing-info reporter-         |     Focuses:  ui, rest-
  feedback                                       |  api
-------------------------------------------------+-------------------------
Changes (by yanksyoon):

 * keywords:   => needs-testing-info reporter-feedback


Comment:

 Here's the payload for the search request on the drodown. As you can see,
 the user amailer is truncated.

 Request URL:
 http://10.1.190.162/index.php?rest_route=%2Fwp%2Fv2%2Fusers&context=view&who=authors&per_page=50&_fields=id%2Cname&search=amailer&_locale=user

 [
     {
         "id": 121,
         "name": "a00nBHN2n"
     },
     {
         "id": 128,
         "name": "a0FG5fai8"
     },
     {
         "id": 122,
         "name": "a0zqyu52Y"
     },
     {
         "id": 152,
         "name": "a1WlKgRrd"
     },
     {
         "id": 139,
         "name": "a2JOvoK4U"
     },
     {
         "id": 126,
         "name": "a3MvWRle4"
     },
     {
         "id": 131,
         "name": "a4DE589VL"
     },
     {
         "id": 150,
         "name": "a4O977lDb"
     },
     {
         "id": 106,
         "name": "a5d0lr7Xj"
     },
     {
         "id": 143,
         "name": "a5RtDr3m8"
     },
     {
         "id": 146,
         "name": "a9N95Xz08"
     },
     {
         "id": 109,
         "name": "a9rELNii5"
     },
     {
         "id": 138,
         "name": "aaa5avW2x"
     },
     {
         "id": 117,
         "name": "aaX3JfIcS"
     },
     {
         "id": 196,
         "name": "ab0BLAopL2"
     },
     {
         "id": 194,
         "name": "ab2Vrf7jPi"
     },
     {
         "id": 136,
         "name": "aB3FWIEC8"
     },
     {
         "id": 110,
         "name": "aB3ssFopr"
     },
     {
         "id": 189,
         "name": "ab6JgXByP1"
     },
     {
         "id": 165,
         "name": "ab7rWeIuRx"
     },
     {
         "id": 154,
         "name": "ab7Wx140Mc"
     },
     {
         "id": 169,
         "name": "ab8eCP8wee"
     },
     {
         "id": 170,
         "name": "ab8tLFxn8P"
     },
     {
         "id": 185,
         "name": "abBt2yCmha"
     },
     {
         "id": 155,
         "name": "abCCmOzobH"
     },
     {
         "id": 184,
         "name": "abCmJGbB7A"
     },
     {
         "id": 161,
         "name": "abCPhCQ7Ti"
     },
     {
         "id": 182,
         "name": "abddaHKfBJ"
     },
     {
         "id": 198,
         "name": "abeLexYU44"
     },
     {
         "id": 173,
         "name": "abEME8SCme"
     },
     {
         "id": 193,
         "name": "abF5dSkbjA"
     },
     {
         "id": 181,
         "name": "abGcPmvw7L"
     },
     {
         "id": 202,
         "name": "abGjvETaMU"
     },
     {
         "id": 180,
         "name": "abh6k1NoFr"
     },
     {
         "id": 195,
         "name": "abH7oqnhtu"
     },
     {
         "id": 197,
         "name": "abIFhNp5qS"
     },
     {
         "id": 171,
         "name": "abiNTHdQwj"
     },
     {
         "id": 176,
         "name": "abISC0qaHt"
     },
     {
         "id": 164,
         "name": "abjVDnDCiH"
     },
     {
         "id": 187,
         "name": "abkiEL8UYR"
     },
     {
         "id": 167,
         "name": "abKXGWYell"
     },
     {
         "id": 178,
         "name": "ablNFeBciS"
     },
     {
         "id": 160,
         "name": "ablR2PTwtl"
     },
     {
         "id": 168,
         "name": "abM7o9SOhv"
     },
     {
         "id": 159,
         "name": "abNZeGAmky"
     },
     {
         "id": 179,
         "name": "abnZfp9hwI"
     },
     {
         "id": 188,
         "name": "abO8Guw00q"
     },
     {
         "id": 158,
         "name": "abOKFtUx7d"
     },
     {
         "id": 186,
         "name": "abpzuABnpt"
     },
     {
         "id": 174,
         "name": "abq6wgH2yB"
     }
 ]

 The script to generate random users:

 ```
 #!/bin/bash

 # Function to generate a random username beginning with 'ab'
 generate_username() {
   local username
   username="ab"

   # Generate a random string of characters
   random_string=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head
 -n 1)

   # Append the random string to the username
   username+="${random_string}"

   echo "$username"
 }

 # Iterate to create 50 users
 for ((i=1; i<=50; i++)); do
   # Generate a random username
   random_username=$(generate_username)

   # Create WordPress user
   wp --allow-root user create "$random_username"
 "$random_username at amailer.com" --role=author

   echo "Created user: $random_username"
 done
 ```

 Then, generate the target user:
 `wp --allow-root user create amailer amailer at amailer.com --role=author`

 Goto create post.
 Select author dropdown on the right panel.
 Search for `amailer` user.
 The user is not found in the dropdown.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60317#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list