Page MenuHomePhabricator

Multiblocks: Display only active blocks on the top of blocked user's Special:Contributions page / when editing a blocked user's user [talk] page
Closed, ResolvedPublic

Description

Summary

Change the "block log excerpt" component shown on Special:Contributions, and shown when editing a blocked user's userpage/user talk page, to ignore expired or removed blocks.

Background

When viewing contributions of a blocked user, above the revisions list, there is a box with the most recent block log entry that relates to this user. Prior to the introduction of multiblocks, this was a convenient place to see, what are the current block's options and what's the reason for it.
A box like this also appears when editing the userpage/user talk page of a blocked user (or when viewing a nonexistent userpage/user talk page for a blocked user).

However, as it's possible to block a user multiple times, it may happen, that for a given blocked user, the most recent entry in the block log will be of the unblock type or will relate to a block that's already expired.

Due to this behavior, wiki users may see a rather uninformative box, presented on the screenshot below. This component can be changed to fetch information from the blocks table, as I believe these are easier to query in this setting and there's already a component for presenting these on Special:Block.

image.png (1,728×166 px, 26 KB)

This screenshot refers to a user that was (in order):

  1. Blocked site-wide
  2. Blocked partially (almost at the same time as 1.)
  3. Blocked site-wide (a redundant block, apparently admin wasn't aware of 1. due to 2. showing in the contribs)
  4. Unblocked site-wide (once, the block from 3. was removed)

User story

As an Admin, I want to see the information about the active blocks of the user, whose contributions I am browsing / whose user [talk] page I am editing, in order to decide if the block configuration is sufficient.

Acceptance criteria

  • The box on Special:Contributions is updated to only display a log entry that matches a currently-active block. (https://gerrit.wikimedia.org/r/1185986)
  • The box shown when editing a blocked user's userpage/talk page is updated in the same way.
  • System messages used when displaying these excerpts are updated/reworded to no longer necessarily refer to the excerpt as the "latest block log entry". (if it's decided that this should happen)
  • Remove messages prefixed with sp-contributions-blocked-notice, in favour of those prefixed with blocked-notice-logextract, which have been newly added.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Msz2001 renamed this task from Multiblocks: Display only active blocks on the top of Special:Contributions page to Multiblocks: Display only active blocks on the top of blocked user's Special:Contributions page.May 12 2025, 2:41 PM
Dragoniez subscribed.

A recent example to demonstrate this issue: A user got blocked by two different admins who opened Special:Block at the same time. The second admin removed his block again, which leads to https://de.wikipedia.org/wiki/Spezial:Beiträge/Haster2?uselang=en&safemode=1 showing the unblock instead of the indefinite block from the first admin (https://de.wikipedia.org/w/index.php?title=Spezial:Logbuch&page=User%3AHaster2&type=block&user=&dir=prev&offset=20241107161556%7C138660209&limit=3&uselang=en&safemode=1)

Screenshot 2025-08-01 at 16.06.22.png (1,854×486 px, 241 KB)

Screenshot 2025-08-01 at 16.06.28.png (1,870×554 px, 145 KB)

This may be solved by option 4 of T384916: Update block log snippets for multiblocks. If the table is too cluttered, we can display a non-table version of block list such as this one: https://web.archive.org/web/20110506001416/http://en.wikipedia.org/wiki/Special:BlockList

Change #1185986 had a related patch set uploaded (by Dragoniez; author: Dragoniez):

[mediawiki/core@master] Display only active block logs on Special:Contributions

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

The patch should resolve the issue. I didn’t address the question of whether to display multiple active blocks instead of just one, though. I think we should address it in a separate task as needed, as this isn’t what this task focuses on and also we can’t leave this bug unresolved for a long time.

Change #1185986 merged by jenkins-bot:

[mediawiki/core@master] Display only active block logs on Special:Contributions

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

Dragoniez removed a project: Patch-For-Review.

Done. I'd like to add that it's not impossible to show multiple block logs if that's preferred, although we should discuss what the maximum number of such entries should be.

Block-notice-multi.png (1,373×460 px, 88 KB)

A_smart_kitten subscribed.

A couple of questions:

  • Should the same change that's been made here (to how a block-log entry is selected for Special:Contributions) also be made for the other location(s) where a snippet of a user's block-log is displayed (e.g., when at the nonexistent userpage of a user that's currently blocked)?
  • Following this change, do we need to update/reword parts of these system messages; to reflect that the log-entry being displayed is no longer necessarily the 'latest block log entry'? If so, what would be the best wording to insert in its place?
Dragoniez removed Dragoniez as the assignee of this task.

It turns out that the patch isn't sufficient and it also needs to address LogEventsList::getBlockLogWarningBox, which generates the block notice shown when someone attempts to edit a user's user/user_talk page. In practice, it would be best to centralize the block log generation logic currently in ContributionsSpecialPage::contributionsSub into this method in the LogEventsList class.

The interface messages used in ContributionsSpecialPage are in a sense more "fine-grained", while LogEventsList only uses two:

  • LogEventsList
{
	"blocked-notice-logextract": "This {{GENDER:$1|user}} is currently blocked.\nThe latest block log entry is provided below for reference:",
	"blocked-notice-logextract-multi": "This {{GENDER:$1|user}} is currently blocked $2 {{PLURAL:$2|time|times}}.\nThe latest block log entry is provided below for reference:",
}
  • ContributionsSpecialPage
{
	"sp-contributions-blocked-notice": "This {{GENDER:$1|user}} is currently blocked.\nThe latest block log entry is provided below for reference:",
	"sp-contributions-blocked-notice-partial": "This {{GENDER:$1|user}} is currently partially blocked.\nThe latest block log entry is provided below for reference:",
	"sp-contributions-blocked-notice-anon": "This IP address is currently blocked.\nThe latest block log entry is provided below for reference:",
	"sp-contributions-blocked-notice-anon-partial": "This IP address is currently partially blocked.\nThe latest block log entry is provided below for reference:",
	"sp-contributions-blocked-notice-multi": "This {{GENDER:$1|user}} is currently blocked $2 {{PLURAL:$2|time|times}}.\nThe latest block log entry is provided below for reference:",
	"sp-contributions-blocked-notice-anon-multi": "This IP address is currently blocked $2 {{PLURAL:$2|time|times}}.\nThe latest block log entry is provided below for reference:",
}

Perhaps we should incorporate the latter into the former if we choose to do everything in LogEventsList::getBlockLogWarningBox.

A_smart_kitten renamed this task from Multiblocks: Display only active blocks on the top of blocked user's Special:Contributions page to Multiblocks: Display only active blocks on the top of blocked user's Special:Contributions page / when editing.Sep 16 2025, 2:01 PM
A_smart_kitten renamed this task from Multiblocks: Display only active blocks on the top of blocked user's Special:Contributions page / when editing to Multiblocks: Display only active blocks on the top of blocked user's Special:Contributions page / when editing a blocked user's user [talk] page.
A_smart_kitten updated the task description. (Show Details)

(Boldly updated the task description & added AC for clarity; feel free to amend as appropriate)

Change #1188868 had a related patch set uploaded (by Dragoniez; author: Dragoniez):

[mediawiki/core@master] Centralize block notice generation logic into LogEventsList::getBlockLogWarningBox

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

@Dragoniez's current patch removes the sp-contributions-blocked-notice system messages, in favour of the (already-existing) blocked-notice-logextract series of messages.
I wonder if this is worth a User-notice, given that - judging by this Global Search - a number of communities override some of the sp-contributions-blocked-notice system messages that seem likely to be removed?

@Dragoniez's current patch removes the sp-contributions-blocked-notice system messages, in favour of the (already-existing) blocked-notice-logextract series of messages.
I wonder if this is worth a User-notice, given that - judging by this Global Search - a number of communities override some of the sp-contributions-blocked-notice system messages that seem likely to be removed?

I can defer removal of the sp-contributions-blocked-notice messages to a follow-up patch to give communities time to translate the new messages before they take effect. If we do this, having a User-notice would indeed be a good option.

How about something like the following?

The rollout of [[<tvar name="1">:mw:Special:MyLanguage/Help:Manage blocks</tvar>|multiblocks]] had the side effect that non-active block logs may have been shown on {{#special:Contributions}} and on blocked users' user/user_talk pages. This issue will be fully resolved in a few days. As part of the fix, [<tvar name="2">{{fullurl:Special:Allmessages|prefix=sp-contributions-blocked-notice}}</tvar> messages prefixed with <tvar name="3"><code>sp-contributions-blocked-notice</code></tvar>] will be removed and replaced with [<tvar name="4">{{fullurl:Special:Allmessages|prefix=blocked-notice-logextract}}</tvar> those prefixed with <tvar name="5"><code>blocked-notice-logextract</code></tvar>] in a few weeks. Please help translate the new messages and update any local overrides if needed.

This reads:

The rollout of multiblocks had the side effect that non-active block logs may have been shown on [[Special:Contributions]] and on blocked users’ user and user_talk pages. This issue will be fully resolved in a few days. As part of the fix, messages prefixed with sp-contributions-blocked-notice will be removed and replaced with those prefixed with blocked-notice-logextract in a few weeks. Please help translate the new messages and update any local overrides if needed.

Test wiki created on Patch demo by A smart kitten using patch(es) linked to this task:
https://e34a5ae872.catalyst.wmcloud.org/wiki/Main Page

How about something like the following?

The rollout of [[<tvar name="1">:mw:Special:MyLanguage/Help:Manage blocks</tvar>|multiblocks]] had the side effect that non-active block logs may have been shown on {{#special:Contributions}} and on blocked users' user/user_talk pages. This issue will be fully resolved in a few days. As part of the fix, [<tvar name="2">{{fullurl:Special:Allmessages|prefix=sp-contributions-blocked-notice}}</tvar> messages prefixed with <tvar name="3"><code>sp-contributions-blocked-notice</code></tvar>] will be removed and replaced with [<tvar name="4">{{fullurl:Special:Allmessages|prefix=blocked-notice-logextract}}</tvar> those prefixed with <tvar name="5"><code>blocked-notice-logextract</code></tvar>] in a few weeks. Please help translate the new messages and update any local overrides if needed.

This reads:

The rollout of multiblocks had the side effect that non-active block logs may have been shown on [[Special:Contributions]] and on blocked users’ user and user_talk pages. This issue will be fully resolved in a few days. As part of the fix, messages prefixed with sp-contributions-blocked-notice will be removed and replaced with those prefixed with blocked-notice-logextract in a few weeks. Please help translate the new messages and update any local overrides if needed.

@Dragoniez When should this be announced?

@UOzurumba Thanks for your comment. It can be announced as soon as gerrit:1188868 is merged. The patch is basically ready and just waiting for a +2.

This issue will be fully resolved in a few days.

Perhaps this should be changed to This issue is resolved now. or something similar once the patch has been merged. I’d appreciate any adjustments if the wording doesn’t seem to match the context or timing of the announcement.

Test wiki created on Patch demo by JNuche (WMF) using patch(es) linked to this task:
https://2c8deb3c0d.catalyst.wmcloud.org/w/

Test wiki on Patch demo by JNuche (WMF) using patch(es) linked to this task was deleted:

https://2c8deb3c0d.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by JNuche (WMF) using patch(es) linked to this task:
https://f9860a71e1.catalyst.wmcloud.org/w/

Test wiki on Patch demo by JNuche (WMF) using patch(es) linked to this task was deleted:

https://f9860a71e1.catalyst.wmcloud.org/w/

^ Please ignore the noise, I was doing some testing

This issue will be fully resolved in a few days.

Perhaps this should be changed to This issue is resolved now. or something similar once the patch has been merged. I’d appreciate any adjustments if the wording doesn’t seem to match the context or timing of the announcement.

I've merged it now. Given that the patch will go out next week, I think the wording should be "The issue will be fully resolved in a few days" so that when it goes out on Monday the 29th users would expect to see the change once it reaches their wiki (which should be by Thursday)

Change #1188868 merged by jenkins-bot:

[mediawiki/core@master] Centralize block notice generation logic into LogEventsList::getBlockLogWarningBox

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

Dragoniez changed the task status from Open to In Progress.Sep 23 2025, 12:42 PM
Dragoniez updated the task description. (Show Details)
Dragoniez removed a project: Patch-For-Review.

What remains is to remove the sp-contributions-blocked-notice messages and fully replace them with the new blocked-notice-logextract messages. I'll deal with this in a couple of weeks, once communities have had reasonable time to translate the new ones.

Note that I didn't update the old messages to include "active" as in "The latest active block log entry", since they're going to be removed. Currently, the new blocked-notice-logextract messages are used only for sitewide (multi-)blocks affecting non-IP users. This means that block notices for partial blocks and IP blocks still use "The latest block log entry", without "active". A follow-up patch will address this and satisfy all the acceptance criteria.

Change #1194561 had a related patch set uploaded (by Dragoniez; author: Dragoniez):

[mediawiki/core@master] Remove `sp-contributions-blocked-notice` messages

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

Dragoniez removed a project: Patch-For-Review.
Dragoniez updated the task description. (Show Details)

Change #1194561 merged by jenkins-bot:

[mediawiki/core@master] Remove `sp-contributions-blocked-notice` messages

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

Thanks for seeing this through @Dragoniez :)

+1 to this

Thanks for seeing this through @Dragoniez :)

Thanks for seeing this through @Dragoniez :)

+1 to this

Sure thing :) Thanks for all the reviews

I just started to wonder about something. With the current specs, the newest active block log is shown consistently, regardless of the user type. However, in a scenario like:

  1. A single IP is blocked (say, 255.255.255.255)
  2. A CIDR containing this IP is blocked afterwards (say, 255.255.255.254/31)

Should we show the block log for 255.255.255.255 instead even though it's older?