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

Change subject: Fix logging
......................................................................


Fix logging

Followup to I69a7091e

Bug: 32782
Change-Id: I3c118679cc29fee49648510190c13e9eeaf1a00f
---
M DisableAccount.i18n.php
M DisableAccount.php
M DisableAccount_body.php
3 files changed, 12 insertions(+), 4 deletions(-)

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



diff --git a/DisableAccount.i18n.php b/DisableAccount.i18n.php
index e2348d2..22b4f69 100644
--- a/DisableAccount.i18n.php
+++ b/DisableAccount.i18n.php
@@ -16,7 +16,7 @@
        'disableaccount-mustconfirm' => 'You must confirm that you wish to 
disable this account.',
        'disableaccount-nosuchuser' => 'The user account "$1" does not exist.',
        'disableaccount-success' => 'The user account "$1" has been permanently 
disabled.',
-       'logentry-block-disableaccount' => 'disabled the account of [[$1]].',
+       'logentry-block-disableaccount' => '$1 {{GENDER:$2|disabled the 
account}} of {{GENDER:$4|$3}}.',
 );
 
 /** Message documentation (Message documentation)
diff --git a/DisableAccount.php b/DisableAccount.php
index 86f8e28..1e88aff 100644
--- a/DisableAccount.php
+++ b/DisableAccount.php
@@ -24,8 +24,15 @@
 $wgAvailableRights[] = 'disableaccount';
 
 // Log
-$wgLogActionsHandlers['block/disableaccount'] = 'disableAccountText';
+$wgLogActionsHandlers['block/disableaccount'] = 'DisableAccountLogFormatter';
 
-function disableAccountText( $type, $action, $target ) {
-       return wfMessage( 'logentry-block-disableaccount', $target );
+class DisableAccountLogFormatter extends LogFormatter {
+       protected function getMessageParameters() {
+               $params = parent::getMessageParameters();
+               if ( count( $params ) == 3 ) {
+                       // Deal with old log entries which don't have this set 
(needed for GENDER support)
+                       $params[3] = $this->entry->getTarget()->getRootText();
+               }
+               return $params;
+       }
 }
diff --git a/DisableAccount_body.php b/DisableAccount_body.php
index f5076f1..f76cc1f 100644
--- a/DisableAccount_body.php
+++ b/DisableAccount_body.php
@@ -61,6 +61,7 @@
                $logEntry = new ManualLogEntry( 'block', 'disableaccount' );
                $logEntry->setPerformer( $wgUser );
                $logEntry->setTarget( $user->getUserPage() );
+               $logEntry->setParameters( array( '4::targetUsername' => 
$user->getName() ) );
                $logId = $logEntry->insert();
                $logEntry->publish( $logId );
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c118679cc29fee49648510190c13e9eeaf1a00f
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/DisableAccount
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to