Do not increment the total site edit count on null edits
authorAaron Schulz <aschulz@wikimedia.org>
Tue, 29 Apr 2014 03:46:16 +0000 (20:46 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 29 Apr 2014 03:46:26 +0000 (20:46 -0700)
Change-Id: I0d8d7bcbbd7783cd9845cb5ec2704e854a083e19

includes/WikiPage.php

index 42dc134..d53acd0 100644 (file)
@@ -2173,19 +2173,17 @@ class WikiPage implements Page, IDBAccessObject {
 
                if ( !$options['changed'] ) {
                        $good = 0;
-                       $total = 0;
                } elseif ( $options['created'] ) {
                        $good = (int)$this->isCountable( $editInfo );
-                       $total = 1;
                } elseif ( $options['oldcountable'] !== null ) {
                        $good = (int)$this->isCountable( $editInfo ) - (int)$options['oldcountable'];
-                       $total = 0;
                } else {
                        $good = 0;
-                       $total = 0;
                }
+               $edits = $options['changed'] ? 1 : 0;
+               $total = $options['created'] ? 1 : 0;
 
-               DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, $good, $total ) );
+               DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, $edits, $good, $total ) );
                DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content ) );
 
                // If this is another user's talk page, update newtalk.