Page MenuHomePhabricator

Infobox (accordion) is inserted before partial block notice [M]
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

ipinfo-accordion.png (1×2 px, 396 KB)

What should have happened instead?:

The infobox (accordion) should be inserted after the notice that the IP is affected by a partial block.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

Event Timeline

Good catch. Do we know if this is true only for the partial block banner?

Good catch. Do we know if this is true only for the partial block banner?

After a little bit of reading of the file that backs the Special:Contributions special page, yes.

The [partial] block banner is inserted after the SpecialPageBeforeExecute hook is run, which we hook into in order to insert the infobox (accordion) into the special pages that we're targeting. There's a more specific hook run on that page just before the "Search for contributions" form is added to the page, SpecialContributionsBeforeMainOutput, which we should investigate.

ARamirez_WMF renamed this task from Infobox (accordion) is inserted before partial block notice to Infobox (accordion) is inserted before partial block notice [M].Oct 13 2021, 4:38 PM

Change 735397 had a related patch set uploaded (by TsepoThoabala; author: TsepoThoabala):

[mediawiki/extensions/IPInfo@master] Insert info box after partial block notice - IPInfo

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

Change 735398 had a related patch set uploaded (by TsepoThoabala; author: TsepoThoabala):

[mediawiki/core@master] Insert info block after partial block notice

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

There's a more specific hook run on that page just before the "Search for contributions" form is added to the page, SpecialContributionsBeforeMainOutput, which we should investigate.

To expand a little on this...

This hook is run here. Looks like it should be possible to use this hook instead of SpecialPageBeforeExecute. See InfoBoxHandler.php where we handle that hook - we should be able to replace the handler onSpecialPageBeforeExecute with a handler onSpecialContributionsBeforeMainOutput, which does pretty much the same thing.

SpecialContributionsBeforeMainOutput is documented here. We should be able to use $user to find the IP address, and $sp to get the special page context, particularly the OutputPage.

Here's some info on how hooks work in MediaWiki: https://www.mediawiki.org/wiki/Manual:Hooks - see in particular https://www.mediawiki.org/wiki/Manual:Hooks#Handling_hooks_in_MediaWiki_1.35_and_later

Change 735397 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Insert info box after partial block notice

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

I have confirmed that issue is fixed and I tested on supported browsers(FF, Chrome, Safari, Opera, Edge and IE)
Note: Also confirmed that when a user has been unblocked, the warming message no long shows on the IP contributions page.

Testing Screen shots:

Screen Shot 2021-11-09 at 1.13.22 PM.png (1×2 px, 662 KB)

Screen Shot 2021-11-09 at 1.18.22 PM.png (1×2 px, 556 KB)

Screen Shot 2021-11-09 at 1.36.51 PM.png (1×2 px, 2 MB)

Change 735398 abandoned by TsepoThoabala:

[mediawiki/core@master] Insert info block after partial block notice

Reason:

Change merged on https://gerrit.wikimedia.org/r/c/mediawiki/extensions/IPInfo/+/735397/

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

Change 740926 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/IPInfo@master] hooks: Fix infobox expanded state regression

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

Change 740926 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] hooks: Fix infobox expanded state regression

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