(bug 18291) rebuildrecentchanges.php failed to add deletion log entries
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 1 Apr 2009 07:10:24 +0000 (07:10 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 1 Apr 2009 07:10:24 +0000 (07:10 +0000)
RELEASE-NOTES
maintenance/rebuildrecentchanges.inc

index 198821d..0dd723c 100644 (file)
@@ -314,6 +314,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 18259) Special:DeletedContributions now also uses
   MediaWiki:Sp-contributions-logs for the link to Special:Log
 * Don't add empty title="" attributes to links to anchors on the current page
+* (bug 18291) rebuildrecentchanges.php failed to add deletion log entries
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index f846d2b..31bc94a 100644 (file)
@@ -142,7 +142,8 @@ function rebuildRecentChangesTablePass3()
        }
        
        $cutoff = time() - $wgRCMaxAge;
-       $dbw->insertSelect( 'recentchanges', array( 'logging', 'page', 'user' ),
+       list($logging, $page) = $dbw->tableNamesN( 'logging', 'page' );
+       $dbw->insertSelect( 'recentchanges', array( 'user', "$logging LEFT JOIN $page ON (log_namespace=page_namespace AND log_title=page_title)" ),
                array(
                        'rc_timestamp'  => 'log_timestamp',
                        'rc_cur_time'   => 'log_timestamp',
@@ -158,7 +159,7 @@ function rebuildRecentChangesTablePass3()
                        'rc_this_oldid' => 0,
                        'rc_last_oldid' => 0,
                        'rc_type'       => RC_LOG,
-                       'rc_cur_id'     => 'page_id',
+                       'rc_cur_id'     => 'COALESCE(page_id, 0)',
                        'rc_log_type'   => 'log_type',
                        'rc_log_action' => 'log_action',
                        'rc_logid'      => 'log_id',
@@ -167,8 +168,6 @@ function rebuildRecentChangesTablePass3()
                ), array(
                        'log_timestamp > ' . $dbw->addQuotes( $dbw->timestamp( $cutoff ) ),
                        'log_user=user_id',
-                       'log_namespace=page_namespace',
-                       'log_title=page_title',
                        'log_type IN(' . implode(',',$selectLogs) . ')'
                ), __METHOD__,
                array(), // INSERT options