site_stats: Unbreak counting newly created pages
authorEddie Greiner-Petter <git@eddie-sh.de>
Fri, 16 Feb 2018 21:18:48 +0000 (22:18 +0100)
committerEddie Greiner-Petter <git@eddie-sh.de>
Fri, 16 Feb 2018 21:20:29 +0000 (22:20 +0100)
Fixes a bug introduced on 331c9f9e2e that stopped newly created pages
from incrementing the counter of ss_total_pages in site_stats. The array
accepted by SiteStatsUpdate::factory is not meant to take a value with
the key 'total'. What's meant here is 'pages'. Let's change the variable
name as well to avoid confusion in the future.

Change-Id: I9c82d926206d9b46f333c6f6cb9d3c7d41db3a53

includes/page/WikiPage.php

index c7bb8ec..a47b001 100644 (file)
@@ -2269,10 +2269,10 @@ class WikiPage implements Page, IDBAccessObject {
                        $good = 0;
                }
                $edits = $options['changed'] ? 1 : 0;
-               $total = $options['created'] ? 1 : 0;
+               $pages = $options['created'] ? 1 : 0;
 
                DeferredUpdates::addUpdate( SiteStatsUpdate::factory(
-                       [ 'edits' => $edits, 'articles' => $good, 'total' => $total ]
+                       [ 'edits' => $edits, 'articles' => $good, 'pages' => $pages ]
                ) );
                DeferredUpdates::addUpdate( new SearchUpdate( $id, $title, $content ) );