TagLogFormatter: For log entries changing both revid and logid tags, prefer revid
authorBartosz Dziewoński <matma.rex@gmail.com>
Mon, 18 Jan 2016 16:59:01 +0000 (17:59 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 20 Jan 2016 13:59:13 +0000 (14:59 +0100)
After 68cc94540d1d6f84b267ab742ce8ff3a46e3ec2f, it's possible for a
single user action to add/remove tags to both a log entry and an
associated page revision (for example for file uploads). I think we
should consider the revision to be the "primary" source of information.

(Even better, we could display both. But that seems like a bit more
work and I'm not sure if it'd be helpful.)

Change-Id: I3c1770346bc559b96c39d0ec40b2375954681d15

includes/logging/TagLogFormatter.php

index 5a58c33..b62bcb4 100644 (file)
@@ -38,10 +38,10 @@ class TagLogFormatter extends LogFormatter {
                $remove = ( isset( $params[8] ) && isset( $params[8]['num'] ) && $params[8]['num'] );
                $key .= ( $remove ? ( $add ? '' : '-remove' ) : '-add' );
 
-               if ( isset( $params[4] ) && $params[4] ) {
-                       $key .= '-logentry';
-               } else {
+               if ( isset( $params[3] ) && $params[3] ) {
                        $key .= '-revision';
+               } else {
+                       $key .= '-logentry';
                }
 
                return $key;