Page MenuHomePhabricator

Special:Block input validation is different after changing to usersmultiselect widget
Closed, InvalidPublicBUG REPORT

Description

What is the problem?

Now that the Special:Block form uses usersmultiselect for user/IP input (since T324602), there are a few differences in the way user input is validated and the validation errors that are shown.

I have found so far:

  • When you enter an invalid/non-existent username, the validation error is Invalid IP address at the top of the page. Previously, the validation error was There is no user by the name "<invalid username>". Check your spelling. next to the input field.
  • If there are more than one validation errors, they do not all show up. This may just affect the user/IP input field, I have not been able to investigate further.
  • Invalid/non-existent usernames/IPs are cleared from the input field after the form reloads.

It seems possible that there are other differences, so we should try to find those as well.

Steps to reproduce problem

First bullet point above:

  1. Go to Special:Block
  2. Type in a non-existent username
  3. Enter an expiration date
  4. Submit

Expected behavior: Some sort of validation error informing you the user is invalid/non-existent.
Observed behavior: The validation message is "Invalid IP Address". The Username/IP field is now empty.

Second bullet point above:

  1. Go to Special:Block
  2. Enter an invalid username
  3. Select an expiration date from the dropdown
  4. Submit
  5. Then re-enter an invalid username
  6. Change the validation dropdown to "other time"
  7. Submit
Environment

Wiki(s): https://de.wikipedia.beta.wmflabs.org MediaWiki 1.41.0-alpha (cbd42f6) 14:04, 28 March 2023.

Screenshots

Invalid username before (local docker):

invalid_username_before.png (290×786 px, 37 KB)

Invalid username after (dewiki beta) (note that the username I had entered is cleared when the form reloads):

invalid_username_after.png (303×792 px, 29 KB)

Multiple validation errors before:

multiple_errors_before.png (800×872 px, 72 KB)

Multiple validation errors after:

multiple_errors_after.png (820×902 px, 69 KB)

Event Timeline

Change 904602 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/CheckUser@master] SpecialBlock.js: Use debounce on API request

https://gerrit.wikimedia.org/r/904602

Change 904704 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] Revert "Update specialblock target text to use usersmultiselect."

https://gerrit.wikimedia.org/r/904704