Page MenuHomePhabricator

SpecialBlock: Accept a block ID to modify a specific block
Open, Needs TriagePublic

Description

Acceptance criteria

SpecialBlock.php

  • The SpecialBlock page should accept an id URL parameter
  • Corresponding data for that specific block should be fetched and all the form fields filled in
  • A hidden input field should be added for the block ID (with the name id)
  • Providing i.e. ?id=123 should be all that is needed to link to modification of the given block; You should not have to also specify the username in the URL.
    • If both an id and username are provided, ignore the username

SpecialBlock.vue

  • Pass the block ID to the Vue app like we do all other data
  • Load the block with the block id into the form on the page
  • A hidden input field should be added for the block ID (with the name id)
  • Submitting the form updates the block, and clears the form

Background

Before, you could only place a single block on a user at a time. So the only information you need to edit a block is the username, since there can only be one block.

With multiblocks, we need a means to modify a specific block on a user. This is necessary for both deep linking in the Vue application, and also for no-JS users.

The no-JS form currently has everything it needs to edit a block, except something specifying the block we want to modify.

Event Timeline

@MusikAnimal just so I understand the scope of this task... It sounds like this represents the need for an admin to edit or modify an existing block. The use case is that an admin looks up a username and IP address, and then clicks a button, which loads the existing block, which could be updated?

The technical solution is to 1) pass a blockID, 2) load the blockID with the info populated in the form, and then 3) allow a user to save it.

Does this sound right?

What happens if an admin creates a block that overlaps the functionality of an existing block on that particular user or agent?

@MusikAnimal just so I understand the scope of this task... It sounds like this represents the need for an admin to edit or modify an existing block.

Correct.

The use case is that an admin looks up a username and IP address, and then clicks a button, which loads the existing block, which could be updated?

Maybe… Just in case it's not clear, what we're talking about here is browsing to Special:Block?blockid=123 from a "change block" link somewhere else, such as at the top of Special:Contribs/BlockedUser.

The technical solution is to 1) pass a blockID, 2) load the blockID with the info populated in the form, and then 3) allow a user to save it.

Pretty much! Imagine loading Special:Block?blockid=123 and everything looks like it does normally (in multiblocks), but the dialog to modify the block with ID 123 is automatically opened.

What happens if an admin creates a block that overlaps the functionality of an existing block on that particular user or agent?

Special:Block will list all active blocks, so I'm thinking it's probably on the admin to ensure there's no redundancy when layering blocks.

Cparle renamed this task from SpecialBlock [multiblocks]: Accept a block ID to modify a specific block to SpecialBlock: Accept a block ID to modify a specific block.Nov 18 2024, 3:45 PM
Cparle updated the task description. (Show Details)
Cparle updated the task description. (Show Details)

@MusikAnimal Can I confirm task size doesn't exceed 1-2 days?

@MusikAnimal Can I confirm task size doesn't exceed 1-2 days?

Confirmed!

This might potentially be covered by other tickets.

In particular these ones

Leaving the ticket open so we can check the functionality is actually covered, but not anticipating any dev work