Last modified: 2008-11-18 13:44:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T8678, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 6678 - Anons who block themselves do not seem to appear in the Blocklist.
Anons who block themselves do not seem to appear in the Blocklist.
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
All All
: Low minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-07-14 05:10 UTC by Nick Jenkins
Modified: 2008-11-18 13:44 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Patch for the impossible (1.81 KB, patch)
2006-07-14 08:29 UTC, Nick Jenkins

Description Nick Jenkins 2006-07-14 05:10:53 UTC
I have given anons permission to block people (LocalSettings contains:
$wgGroupPermissions['*']['block'] = true;)

So as an anon, I tried blocking myself (by IP address) for 2 hours.

This worked. So then I logged in to my named account, with the intention of
unblocking my IP address.

What I would expect at Special:Ipblocklist is to see the blocked IP address in
the list. However, it says "The blocklist is empty".

Bypassing mediawiki and going to the db layer shows this is not the case:

mysql> select * from ipblocks;
| ipb_id | ipb_address | ipb_user | ipb_by | ipb_reason | ipb_timestamp  |
ipb_auto | ipb_anon_only | ipb_create_account | ipb_expiry     | ipb_range_start
| ipb_range_end |
|      1 | |        0 |      0 |            | 20060714044007 |     
  0 |             0 |                  1 | 20060714064007 |                 |  
1 row in set (0.00 sec)

Then when I try to edit as an the anon, I get this message:
" Your user name or IP address has been blocked. The block was made by
[[User:|]]. The reason given is ' "

Is this normal? Doesn't a limited time block still appear in the blocklist? It
seems to work as expected provided the block is done by a named account, but
seems to get its knickers in a twist when the blocking is done by an anon.
Comment 1 Brion Vibber 2006-07-14 05:33:19 UTC
Don't do that, it will break if you ask the software to do 
impossible things.
Comment 2 Nick Jenkins 2006-07-14 08:29:51 UTC
Created attachment 2084 [details]
Patch for the impossible

IPBlocklistPager::getQueryInfo() uses a join between the 'user' and 'ipblocks'
tables. In the case of a block made by an anon, there will be no corresponding
user row, hence the block still exists, is still enforced, but just is not
visible on Special:Ipblocklist. With this it is listed, but by user "unknown",
since the person who did the blocking is unknown by Special:Ipblocklist.
Comment 3 Chad H. 2008-11-18 13:44:55 UTC
Fixed some time ago with the advent of ipb_by_text.

Note You need to log in before you can comment on or make changes to this bug.