Bsitu has uploaded a new change for review.

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


Change subject: (bug 45337) reverts/rollback should not trigger link notif
......................................................................

(bug 45337) reverts/rollback should not trigger link notif

Change-Id: I7ca7687f271aae53a000affdc10c1ed3758dcb83
---
M Hooks.php
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/89/54589/1

diff --git a/Hooks.php b/Hooks.php
index 75bcf87..9c40549 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -454,6 +454,15 @@
         * @return bool
         */
        public static function onLinksUpdateAfterInsert( $linksUpdate, $table, 
$insertions ) {
+               global $wgRequest, $wgUser;
+
+               // Rollback or undo should not trigger link notification
+               // @Todo Implement a better solution so it doesn't depend on 
the checking of
+               // a specific set of request variables
+               if ( $wgRequest->getVal( 'wpUndidRevision' ) || 
$wgRequest->getVal( 'action' ) == 'rollback' ) {
+                       return true;
+               }
+
                // Handle only
                // 1. inserts to pagelinks table && 
                // 2. content namespace pages &&
@@ -477,7 +486,6 @@
                        return true;
                }
 
-               global $wgUser;
                EchoEvent::create( array(
                        'type' => 'article-linked',
                        'title' => $linksUpdate->mTitle,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ca7687f271aae53a000affdc10c1ed3758dcb83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

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

Reply via email to