Page MenuHomePhabricator

Special:Block form: Read URL parameters to preset form fields
Closed, ResolvedPublic

Assigned To
Authored By
HMonroy
Jun 26 2024, 10:02 PM
Referenced Files
F57622227: 2024-10-17_10-45-43.png
Oct 17 2024, 5:49 PM
F57605221: 2024-10-10_15-39-08.mp4.gif
Oct 10 2024, 10:46 PM
F57605219: 2024-10-10_15-37-59.mp4.gif
Oct 10 2024, 10:46 PM
F57573944: 2024-09-30_16-21-23.png
Sep 30 2024, 11:25 PM
F57573940: 2024-09-30_16-23-08.png
Sep 30 2024, 11:25 PM
F57573392: 2024-09-30_13-40-23.png
Sep 30 2024, 8:44 PM
F57573390: 2024-09-30_13-39-47.png
Sep 30 2024, 8:44 PM

Description

Feature summary:

Implement URL parameters, like wpAutoBlock and wpWatch, to preset the checkboxes in Special:Block. All fields listed in https://www.mediawiki.org/wiki/Manual:Block_and_unblock#URL_parameters should be able to preset via the URL.

Steps to reproduce:

  1. Set $wgUseCodexSpecialBlock = true;
  2. Log in as an admin
  3. Navigate to e.g. /Special:Block?wpWatch=1.
  4. Note that the Watch this user's user and talk pages checkbox is checked.

Derived Requirement

Ensure that the URL parameters wpAutoBlock and wpWatch preset the corresponding checkboxes in Special when $wgUseCodexSpecialBlock = true.

BDD

Feature: URL Parameters Preset Checkboxes on Special:Block

Scenario: Ensure wpWatch URL parameter presets the Watch checkbox

Given the user is logged in as an admin with `$wgUseCodexSpecialBlock = true`
When the user navigates to `/Special:Block?wpWatch=1`
Then the "Watch this user's user and talk pages" checkbox should be checked

Scenario: Ensure wpAutoBlock URL parameter presets the Autoblock checkbox

Given the user is logged in as an admin with `$wgUseCodexSpecialBlock = true`
When the user navigates to `/Special:Block?wpAutoBlock=1`
Then the "Automatically block the last IP address used by this user" checkbox should be checked
Test Steps

Test Case 1: Ensure wpWatch Parameter Presets Watch Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpWatch=1.
  3. ✅❓❌⬜ AC1: Confirm that the "Watch this user's user and talk pages" checkbox is not checked.

Test Case 2: Ensure wpAutoBlock Parameter Presets Autoblock Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpAutoBlock=1.
  3. ✅❓❌⬜ AC2: Confirm that the "Automatically block the last IP address used by this user" checkbox is checked.

QA Results - Test Beta

ACStatusDetails
1T368583#10220055
1T368583#10220055

Event Timeline

Works for me, at least with:

?wpWatch=1
?wpHardBlock=1
?wpAutoBlock=0 to uncheck the site-default

This is for $wgUseCodexSpecialBlock = true;, where the pre-fill values don't yet work.

MusikAnimal renamed this task from Special:Block form: Read URL parameters to preset checkboxes to Special:Block form: Read URL parameters to preset form fields.Aug 28 2024, 9:36 PM
MusikAnimal updated the task description. (Show Details)
MusikAnimal subscribed.

This should be handled once in SpecialBlock.vue and passed as props to each child component.

Change #1073910 had a related patch set uploaded (by HMonroy; author: HMonroy):

[mediawiki/core@master] mediawiki.special.block: read parameters from URL and preset form fields

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

Change #1073910 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.special.block: read parameters from URL and preset form fields

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

@HMonroy For AC1, are both supposed to be checked off, or should it just be "Watch this user's user and talk pages"? Just wondering since in AC2 , /Special:Block?wpAutoBlock=1, only "Automatically block the last IP address used by this user" has been checked off.

Status:
Environment: Local: 1.43.0-alpha (c6e977a) 20:18, 30 September 2024
OS: macOS Sonoma 15.0
Browser: Chrome 129
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure wpWatch Parameter Presets Watch Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpWatch=1.

3.❓AC1: Confirm that the "Watch this user's user and talk pages" checkbox is checked.

2024-09-30_13-39-47.png (725×1 px, 325 KB)

Test Case 2: Ensure wpAutoBlock Parameter Presets Autoblock Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpAutoBlock=1.
  3. ✅ AC2: Confirm that the "Automatically block the last IP address used by this user" checkbox is checked.

2024-09-30_13-40-23.png (851×1 px, 357 KB)

@HMonroy For AC1, are both supposed to be checked off, or should it just be "Watch this user's user and talk pages"? Just wondering since in AC2 , /Special:Block?wpAutoBlock=1, only "Automatically block the last IP address used by this user" has been checked off.

Status:
Environment: Local: 1.43.0-alpha (c6e977a) 20:18, 30 September 2024
OS: macOS Sonoma 15.0
Browser: Chrome 129
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Ensure wpWatch Parameter Presets Watch Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpWatch=1.

3.❓AC1: Confirm that the "Watch this user's user and talk pages" checkbox is checked.

2024-09-30_13-39-47.png (725×1 px, 325 KB)

Test Case 2: Ensure wpAutoBlock Parameter Presets Autoblock Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpAutoBlock=1.
  3. ✅ AC2: Confirm that the "Automatically block the last IP address used by this user" checkbox is checked.

2024-09-30_13-40-23.png (851×1 px, 357 KB)

@GMikesell-WMF Correct, each checkbox has its own parameter. If you inspect using the browser, the value for each checkbox is the parameter that we can use in the url to set the checkbox.

@HMonroy I see what you are saying like the screenshots below. I will move this to Done. Thanks for all your work!

wpAutoBlockwpWatch
2024-09-30_16-23-08.png (501×1 px, 103 KB)
2024-09-30_16-21-23.png (607×1 px, 144 KB)

Change #1077508 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] ExpiryField.vue: fix preselection of expiry field and add tests

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

Change #1078517 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] SpecialBlock.vue: add new NamespacesField and PagesField components

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

Change #1077508 merged by jenkins-bot:

[mediawiki/core@master] ExpiryField.vue: fix preselection of expiry field and add tests

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

Change #1078541 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] SpecialBlock: don't pass blank expiry to wfTimestamp

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

Change #1078541 merged by jenkins-bot:

[mediawiki/core@master] SpecialBlock: don't pass blank expiry to wfTimestamp

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

Change #1078760 had a related patch set uploaded (by HMonroy; author: HMonroy):

[mediawiki/core@master] mediawiki.special.block: Preset remaining URL parameters

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

Change #1078760 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.special.block: Preset remaining URL parameters

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

@HMonroy Please review AC1, thanks!

*UPDATE*- Task description is now updated to have "Watch this user's user and talk pages".

Status: ✅ PASS
Environment: Test Beta
OS: macOS Sonoma 15.0
Browser: Chrome 129
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://test.wikipedia.beta.wmflabs.org/wiki/Special:Block
https://test.wikipedia.beta.wmflabs.org/wiki/Special:Block?wpWatch=1
https://test.wikipedia.beta.wmflabs.org/wiki/Special:Block?wpAutoblock=1

Test Steps

Test Case 1: Ensure wpWatch Parameter Presets Watch Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpWatch=1.

3.✅ AC1: Navigate to e.g. /Special:Block?wpWatch=1.
Note that the Watch this user's user and talk pages checkbox is not checked.

In your task description, you have "Watch this user's user and talk pages" checkbox is not checked. Did you mean that it should be checked? If so, can you update the task please? Then I can update the status of this task, thanks!

Task description has been updated

2024-10-17_10-45-43.png (1×1 px, 213 KB)

Test Case 2: Ensure wpAutoBlock Parameter Presets Autoblock Checkbox

  1. Set $wgUseCodexSpecialBlock = true in the configuration.
  2. Log in as an admin and navigate to /Special:Block?wpAutoBlock=1.
  3. ✅ AC2: Confirm that the "Automatically block the last IP address used by this user" checkbox is checked.

2024-10-10_15-39-08.mp4.gif (1×1 px, 1 MB)

Change #1081305 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/core@master] SpecialBlock [Codex]: fix presetting of relative and infinity wpExpiry

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

Change #1081305 merged by jenkins-bot:

[mediawiki/core@master] SpecialBlock [Codex]: fix presetting of relative and infinity wpExpiry

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

Change #1078517 merged by jenkins-bot:

[mediawiki/core@master] SpecialBlock [Vue]: add NamespacesField and PagesField components

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