Page MenuHomePhabricator

Block messages are inconsistent if a user is blocked from email
Closed, ResolvedPublic1 Estimated Story Points

Description

On Special:EmailUser, if a user is partially blocked and blocked from email, they see a custom block error message:

composite_partial_email.png (272×1 px, 28 KB)

If a user is sitewide blocked and blocked from email, they see the error message with the key 'blockedtext'. This is not customized for email and is not designed to work with different types of block (e.g. system block, composite block, autoblock), resulting in problems like those discussed in T227174#5575175. For example:

composite_sitewide_email.png (269×1 px, 33 KB)

The problem is that SpecialEmailUser selects its block message key directly, whereas other places throw a UserBlockedError, which gets the message via the BlockErrorFormatter, which selects the appropriate message depending on the block.

Solution

We could simply throw a UserBlockedError from Special:EmailUser. This would immediately improve the block messages for all types of sitewide blocks. For partial blocks, we would need to solve T233206 first, to avoid a confusing message.

Event Timeline

This seems to be about MediaWiki-Email, hence adding corresponding project code base tag.

Tchanders renamed this task from Block messages are inconsistent if a user is partially blocked and blocked from email to Block messages are inconsistent if a user is blocked from email.Oct 15 2019, 4:22 PM
Tchanders updated the task description. (Show Details)

Change 543847 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] Throw a UserBlockedError from Special:Emailuser if a user is blocked

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

Niharika triaged this task as Medium priority.Oct 17 2019, 6:40 PM
Niharika set the point value for this task to 1.

Change 543847 merged by jenkins-bot:
[mediawiki/core@master] Throw a UserBlockedError from Special:Emailuser if a user is blocked

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

dom_walden subscribed.

Block error message for Special:EmailUser now looks ok for composite blocks, including in non-default language (French).

specialemail_composite.png (373×675 px, 24 KB)

We don't distinguish between partial and sitewide blocks anymore.

I also retested IP, Username and cookie (auto) blocks.

There do not seem to be any system blocks which block emailing (including extensions), apart from TorBlock with $wgGroupPermissions['user']['torunblocked'] = false;)

Testing on https://en.wikipedia.beta.wmflabs.org 1.35.0-alpha (2096315) 09:39, 25 October 2019).