Page MenuHomePhabricator

Special:UserRights: After invalid "Other" expiry the input disappears
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

When adding a user to a group, if I select "Other" expiry option and enter an invalid value in the input box, after I submit the form I see a validation error but the input box does not appear.

You have to select a different expiry option and then select "Other" again for it to reappear.

Steps to reproduce problem
  1. Login as a user in the stewards group
  2. Go to Special:UserRights/<user> for any existing <user>
  3. Check one of the checkboxes, open the expiry dropdown and select "Other"
  4. A new input box should appear. Enter an invalid value, e.g. 1.5 hours
  5. Submit
Environment

Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.46.0-alpha (8d01c6d) 22:48, 27 November 2025.

Screenshots

invalid_other_expiry_before.png (516×672 px, 60 KB)

invalid_other_expiry_after.png (543×657 px, 63 KB)

Event Timeline

Umherirrender subscribed.

Uses the selectorother html form field backed with OOUI, so maybe something with SelectWithInputWidget and the inital state.

Change #1215151 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] SelectWithInputWidget: Avoid FOUC when initial value is not "other"

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

It's actually a bug specific to Special:UserRights, so adding back the tags, but I'm fixing it by improving SelectWithInputWidget so that the code that caused the bug is no longer needed.

Change #1215151 merged by jenkins-bot:

[mediawiki/core@master] SelectWithInputWidget: Avoid FOUC when initial value is not "other"

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