Page MenuHomePhabricator

Special:Block without JavaScript: "Other" field in Expiration section is required even if "Other" is not selected
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

What is the problem?

To submit the Special:Block form with JavaScript disabled, I am required to type some text into the Other input even if the "Other" expiration option has not been selected.

nojs_other_expiration.png (724×1 px, 41 KB)

It does not seem to matter what you type into this field.

With JS enabled, this input disappears when another option is selected.

Steps to reproduce problem
  1. Disable javascript on the browser
  2. Go to Special:Block (need to be admin)
  3. Attempt to submit a block with an Expiration option other than "Other time:"

Expected behavior: You are not required to type any text into the text input box under "Expiration"
Observed behavior: You are prevented from submitting until you type any text in the input

Event Timeline

Niharika triaged this task as Medium priority.Apr 9 2019, 5:33 PM
Niharika moved this task from Untriaged to Triage/To be Estimated on the Anti-Harassment board.
dbarratt renamed this task from [BUG] Special:Block without JavaScript: "Other" field in Expiration section is required even if "Other" is not selected to Special:Block without JavaScript: "Other" field in Expiration section is required even if "Other" is not selected.Jul 19 2019, 6:49 PM
dbarratt claimed this task.

Change 524945 had a related patch set uploaded (by Dbarratt; owner: Dbarratt):
[mediawiki/core@master] Allow SelectWithInput to be marked as required and handle that dynamically

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

Change 524945 merged by jenkins-bot:
[mediawiki/core@master] Allow SelectWithInput to be marked as required and handle that dynamically

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

Without JS, it is not longer required to enter a value into the "Other" field (unless the "Other" dropdown is selected).

With JS, things behave as before (the "Other" field does not appear unless the "Other" dropdown is selected).

I also briefly tested Special:Block on mobile and IE11 (both with and without JS).

For regression purposes, I tested that there was nothing stopping me submitting a valid block (with and without JS).

Via the API: the error "Expiry time invalid." appears whenever the "expiry" parameter is invalid.