jenkins-bot has submitted this change and it was merged.

Change subject: Make Special:Unblock link to contributions page for IP blockees
......................................................................


Make Special:Unblock link to contributions page for IP blockees

Currently, Special:Unblock links to the user page of anon editors,
which is inconsistent with other areas of the software,
and also less useful, as IP userpages are often redlinks.
This patch converts these links to Contributions links.

Originally reported on Wikia, with an (incomplete) patch here:
https://github.com/WikiaVolDev/app/compare/VOLDEV-31

Change-Id: I0fc73c7ee4fd7c81ed876717e8f60749c51685ae
---
M includes/specials/SpecialUnblock.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 14 insertions(+), 4 deletions(-)

Approvals:
  Siebrand: Looks good to me, but someone else must approve
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialUnblock.php 
b/includes/specials/SpecialUnblock.php
index 96e4dbf..244b889 100644
--- a/includes/specials/SpecialUnblock.php
+++ b/includes/specials/SpecialUnblock.php
@@ -63,8 +63,10 @@
 
                if ( $form->show() ) {
                        switch ( $this->type ) {
-                               case Block::TYPE_USER:
                                case Block::TYPE_IP:
+                                       $out->addWikiMsg( 'unblocked-ip', 
wfEscapeWikiText( $this->target ) );
+                                       break;
+                               case Block::TYPE_USER:
                                        $out->addWikiMsg( 'unblocked', 
wfEscapeWikiText( $this->target ) );
                                        break;
                                case Block::TYPE_RANGE:
@@ -111,8 +113,14 @@
                                $fields['Target']['default'] = $target;
                                $fields['Target']['type'] = 'hidden';
                                switch ( $type ) {
-                                       case Block::TYPE_USER:
                                        case Block::TYPE_IP:
+                                               $fields['Name']['default'] = 
Linker::linkKnown(
+                                                       
SpecialPage::getTitleFor( 'Contributions', $target->getName() ),
+                                                       $target->getName()
+                                               );
+                                               $fields['Name']['raw'] = true;
+                                               break;
+                                       case Block::TYPE_USER:
                                                $fields['Name']['default'] = 
Linker::link(
                                                        $target->getUserPage(),
                                                        $target->getName()
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 6fe2ee2..574d977 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -2083,6 +2083,7 @@
        "unblocked": "[[User:$1|$1]] has been unblocked.",
        "unblocked-range": "$1 has been unblocked.",
        "unblocked-id": "Block $1 has been removed.",
+       "unblocked-ip": "[[Special:Contributions/$1|$1]] has been unblocked.",
        "blocklist": "Blocked users",
        "ipblocklist": "Blocked users",
        "ipblocklist-legend": "Find a blocked user",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 63bd617..4d9ca6c 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -2242,9 +2242,10 @@
        "unblockip": "Used as legend for the form in [[Special:Unblock]].",
        "unblockiptext": "Used in the {{msg-mw|Unblockip}} form on 
[[Special:Unblock]].",
        "ipusubmit": "Used as button text on 
[{{canonicalurl:Special:BlockList|action=unblock}} 
Special:BlockList?action=unblock]. To see the message:\n* Go to 
[[Special:BlockList]]\n* Click \"unblock\" for any block (but you can only see 
\"unblock\" if you have administrator rights)\n* It is now the button below the 
form",
-       "unblocked": "{{doc-important|Do not translate the namespace 
\"User:\".}}\nParameters:\n* $1 - the IP address or username that was 
unblocked\nSee also:\n* {{msg-mw|Unblocked-range}}\n* {{msg-mw|Unblocked-id}}",
-       "unblocked-range": "Shown when successfully lifting a rangeblock, so do 
not link to contributions. Parameters:\n* $1 - the range that was 
unblocked\nSee also:\n* {{msg-mw|Unblocked}}\n* {{msg-mw|Unblocked-id}}",
+       "unblocked": "{{doc-important|Do not translate the namespace 
\"User:\".}}\nParameters:\n* $1 - the username that was unblocked\nSee also:\n* 
{{msg-mw|Unblocked-range}}\n* 
{{msg-mw|Unblocked-id}}\n*{{msg-mw|Unblocked-ip}}",
+       "unblocked-range": "Shown when successfully lifting a rangeblock, so do 
not link to contributions. Parameters:\n* $1 - the range that was 
unblocked\nSee also:\n* {{msg-mw|Unblocked}}\n* 
{{msg-mw|Unblocked-id}}\n*{{msg-mw|Unblocked-ip}}",
        "unblocked-id": "Used in [[Special:Unblock]]. Parameters:\n* $1 - 
autoblock ID\nSee also:\n* {{msg-mw|Unblocked}}\n* {{msg-mw|Unblocked-range}}",
+       "unblocked-ip": "{{doc-important|Do not translate the title 
\"Special:Contributions\".}}\nParameters:\n* $1 - the IP address that was 
unblocked\nSee also:\n* {{msg-mw|Unblocked-range}}\n* 
{{msg-mw|Unblocked-id}}\n*{{msg-mw|Unblocked}}",
        "blocklist": "{{doc-special|BlockList}}",
        "ipblocklist": "Title of [[Special:Ipblocklist]].",
        "ipblocklist-legend": "Used as legend of the form in 
[[Special:BlockList]].\n\nSee also:\n* {{msg-mw|Ipblocklist-legend}}\n* 
{{msg-mw|Ipblocklist-submit}}",

-- 
To view, visit https://gerrit.wikimedia.org/r/144829
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0fc73c7ee4fd7c81ed876717e8f60749c51685ae
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TK-999 <[email protected]>
Gerrit-Reviewer: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: IAlex <[email protected]>
Gerrit-Reviewer: Isarra <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: Nemo bis <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to