What is the problem?
I have observed several circumstances where the Special:Block form is not reset properly. Some of these seem to be regressions of bugs which in the past were fixed.
These include:
- Form not being reset after successful submit (originally fixed in T379215)
- Form not being reset while editing block and clicking "Add block" to try to create a new block
- Form not being reset when switching block targets
There are possibly other examples that are yet to be found.
Steps to reproduce problem
One
- Go to Special:Block/<target> for a <target> that is already blocked
- Open the Active blocks accordion and click "Edit" on one of the rows
- Make a few changes to the block and click "Update block"
- Click "Add block"
Expected behaviour: The form should be reset to its blank state.
Observed behaviour: The form has the same state as when you submitted the form in step 3.
Two
- Go to Special:Block/<target> for a <target> that is already blocked
- Open the Active blocks accordion and click "Edit" on one of the rows
- Open the Active blocks accordion again (if necessary) and click "Add block"
Expected behaviour: The form should be reset to its blank state. Submitting the form should create a new block.
Observed behaviour: The state of the form is the same as in step 2. Submitting the form will update the block you selected in step 2.
Three
- Go to Special:Block/<target> for a <target> that is already blocked
- Open the Active blocks accordion and click "Edit" on one of the rows
- Change the Target input to a new target
- Click "Add block"
- Fill out the form and submit
Expected behaviour: The new target you entered in step 3 is blocked.
Observed behaviour: The original target from step 1 has its block updated.
Environment
Browser: Firefox 128.
Wiki(s): local docker MediaWiki 1.44.0-alpha (b3d4c9e) 08:27, 27 January 2025.
Screenshots
Derived Requirements
- Form Reset After Successful Submission:
- After submitting a block update or a new block, the Special:Block form should reset to its default state.
- Form Reset When Switching Between Editing and Adding a Block:
- If a user is editing an existing block and then clicks "Add block", the form should reset and allow the user to create a new block instead of retaining the previously edited block’s data.
- Form Reset When Changing the Block Target:
- If a user edits a block and then changes the target user/IP, the form should reflect the new target when submitted, rather than modifying the previously selected target.
Test Steps
Test Case 1: Ensure Form Resets After Successful Submission
- Go to Special:Block/<target> for a <target> that is already blocked
- Open the Active blocks accordion and click "Edit" on one of the rows
- Make a few changes to the block and click "Update block"
- Click "Add block"
- ✅❓❌⬜ AC1: Verify that the form should be reset to its blank state.
Test Case 2: Ensure Form Resets When Switching from Edit Mode to Add Block
- Go to Special:Block/<target> for a <target> that is already blocked
- Open the Active blocks accordion and click "Edit" on one of the rows
- Open the Active blocks accordion again (if necessary) and click "Add block"
- ✅❓❌⬜ AC2: Confirm that the form should be reset to its blank state. Submitting the form should create a new block.
Test Case 3: Ensure Form Resets When Switching Targets
- Go to Special:Block/<target> for a <target> that is already blocked
- Open the Active blocks accordion and click "Edit" on one of the rows
- Change the Target input to a new target
- Click "Add block"
- Fill out the form and submit
- ✅❓❌⬜ AC3: Verify that the new target you entered in step 3 is blocked.
Test Case 4: Ensure Form Resets Properly When Clicking "Add Block" After Visiting an Existing Block ID
- Navigate to Special:Block/\<user\>?id=\<id\> for an existing block ID.
- Go to Contributions
- Select Change block
- Click Cancel
- Click "Add block".
- ✅❓❌⬜ AC4: Verify that the form resets immediately and allows for a new block to be created.
QA Results - Local
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T384822#10607602 |
| 2 | ✅ | T384822#10607602 |
| 3 | ✅ | T384822#10607602 |
| 4 | ✅ | T384822#10607602 |






