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

Change subject: Write log entries for showlist and hidelist to Special:Log
......................................................................


Write log entries for showlist and hidelist to Special:Log

http://localhost:8888/w/index.php?title=Special%3ALog&type=&user=&page=special%3AGather&pattern=1
will now show hidelist and showlist actions.
* Also clean up some broken data - invalid url and irrelevant parameter
left over from testing.

Note: Showing as red link for some reason but URLs work.

Bug: T95250
Change-Id: I8f27acd82916ab799277a4fce21e7b9d407afab7
---
M i18n/en.json
M includes/api/ApiEditList.php
2 files changed, 19 insertions(+), 13 deletions(-)

Approvals:
  Jhernandez: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 5fb5447..9f0269c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -11,7 +11,7 @@
        "gather": "Gather",
        "gathereditfeed": "Gather lists edit feed",
        "gatherlists": "Gather lists",
-       "gather-checkuser-log-action": "performed action \"$1\" on $2 via the 
Gather extension",
+       "gather-checkuser-log-action": "performed action \"$1\" on [[$2]] via 
the Gather extension",
        "gather-purpose-login-action": "<b>Now you can group pages into 
collections to share with friends or save for later.</b><br/>Log in to try.",
        "gather-purpose-signup-action": "<b>Now you can group pages into 
collections to share with friends or save for later.</b><br/>Sign up to try.",
        "gather-lists-showhidden": "Show hidden lists",
diff --git a/includes/api/ApiEditList.php b/includes/api/ApiEditList.php
index 9178c6b..9a38651 100644
--- a/includes/api/ApiEditList.php
+++ b/includes/api/ApiEditList.php
@@ -171,21 +171,27 @@
         */
        private function logEntry( $action, $id ) {
                // If CheckUser installed, give it a heads up
+               $user = $this->getUser();
+               $target = SpecialPage::getTitleFor( 'Gather' )->getSubPage( 
'id' )
+                       ->getSubPage( $id );
+               $entry = new ManualLogEntry( 'gather', 'action' );
+               $entry->setPerformer( $user );
+               $entry->setTarget( $target );
+               $params = array(
+                       'action' => $action,
+               );
+               $entry->setParameters( $params );
+               $rc = $entry->getRecentChange();
+
                if ( is_callable( '\CheckUserHooks::updateCheckUserData' ) ) {
-                       $user = $this->getUser();
-                       $target = SpecialPage::getTitleFor( 'Gather' 
)->getSubPage( 'by' )
-                               ->getSubPage( $user->getName() )->getSubPage( 
$id  );
-                       $entry = new ManualLogEntry( 'gather', 'action' );
-                       $entry->setPerformer( $user );
-                       $entry->setTarget( $target );
-                       $params = array(
-                               'username' => 'bob',
-                               'action' => $action,
-                       );
-                       $entry->setParameters( $params );
-                       $rc = $entry->getRecentChange();
                        \CheckUserHooks::updateCheckUserData( $rc );
                }
+
+               // Surface hide and unhide actions in Special:Log
+               if ( $action === 'hidelist' || $action === 'showlist' ) {
+                       $logId = $entry->insert();
+                       $entry->publish( $logId, 'udp' );
+               }
        }
 
        /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f27acd82916ab799277a4fce21e7b9d407afab7
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Jhernandez <jhernan...@wikimedia.org>
Gerrit-Reviewer: Robmoen <rm...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to