Fix a rather fatal typo in rebuildrecentchanges.php
authorJack Phoenix <ashley@uncyclomedia.co>
Tue, 5 Mar 2019 23:13:59 +0000 (01:13 +0200)
committerJack Phoenix <ashley@uncyclomedia.co>
Tue, 5 Mar 2019 23:13:59 +0000 (01:13 +0200)
The JOIN condition was being ignored because there is no table called "user_group" in MediaWiki core.
Thus if and when using $wgSharedDB, the query would end up listing *all* registered users from the shared user table.
And even without $wgSharedDB, running rebuildrecentchanges.php would result in everyone's edits being marked as bot edits (recentchanges.rc_bot = 1) and thus hidden from the Special:RecentChanges page.

Thanks to Lcawte for reporting this bug.

Follow-up to 27c61fb1e94da9114314468fd00bcf129ec064b6

Change-Id: I18d658b67c50f2200341f732783c2e7524dd27f1

maintenance/rebuildrecentchanges.php

index 45bb6de..900f1d6 100644 (file)
@@ -372,7 +372,7 @@ class RebuildRecentchanges extends Maintenance {
                                [ 'ug_group' => $botgroups ],
                                __METHOD__,
                                [ 'DISTINCT' ],
-                               [ 'user_group' => [ 'JOIN', 'user_id = ug_user' ] ] + $userQuery['joins']
+                               [ 'user_groups' => [ 'JOIN', 'user_id = ug_user' ] ] + $userQuery['joins']
                        );
 
                        $botusers = [];