Update the change_tag table in rebuildrecentchanges.php
authorGeoffreyT2000 <geoffreytrang@gmail.com>
Fri, 1 Mar 2019 03:47:38 +0000 (19:47 -0800)
committerReedy <reedy@wikimedia.org>
Thu, 28 May 2020 20:20:09 +0000 (20:20 +0000)
Without updating the change_tag table, tags will not correctly appear on
Special:RecentChanges after running the script.

Bug: T229461
Change-Id: Iff12588df1ad8d658091832e38d870dd8b75a32f
(cherry picked from commit 4c69162b95afc3dd3d7a1fa51cee207e6fe0171b)

maintenance/rebuildrecentchanges.php

index 9c2549f..03ab64e 100644 (file)
@@ -168,6 +168,15 @@ class RebuildRecentchanges extends Maintenance {
                                        + $actorMigration->getInsertValues( $dbw, 'rc_user', $user ),
                                __METHOD__
                        );
+
+                       $rcid = $dbw->insertId();
+                       $dbw->update(
+                               'change_tag',
+                               [ 'ct_rc_id' => $rcid ],
+                               [ 'ct_rev_id' => $row->rev_id ],
+                               __METHOD__
+                       );
+
                        if ( ( ++$inserted % $this->getBatchSize() ) == 0 ) {
                                $lbFactory->waitForReplication();
                        }
@@ -340,6 +349,14 @@ class RebuildRecentchanges extends Maintenance {
                                __METHOD__
                        );
 
+                       $rcid = $dbw->insertId();
+                       $dbw->update(
+                               'change_tag',
+                               [ 'ct_rc_id' => $rcid ],
+                               [ 'ct_log_id' => $row->log_id ],
+                               __METHOD__
+                       );
+
                        if ( ( ++$inserted % $this->getBatchSize() ) == 0 ) {
                                $lbFactory->waitForReplication();
                        }