Page MenuHomePhabricator

bugfix_17536_recentchanges.diff

Authored By
bzimport
Nov 21 2014, 10:30 PM
Size
1 KB
Referenced Files
None
Subscribers
None

bugfix_17536_recentchanges.diff

Index: RecentChange.php
===================================================================
--- RecentChange.php (revision 47522)
+++ RecentChange.php (working copy)
@@ -478,6 +478,25 @@
'actionComment' => $actionComment, // the comment appended to the action, passed from LogPage
);
$rc->save();
+
+ #BUGFIX 17536: if the moved page is new update the rc log
+ if( $type == 'move')
+ {
+ $dbw = wfGetDB( DB_SLAVE );
+ #Load destination title
+ $p = LogPage::extractParams($params);
+ $nt = Title::newFromText( $p[0] );
+ #Check if the page is new
+ if( $rc_id = $dbw->selectField('recentchanges', array( 'rc_id' ), array("rc_cur_id" => $nt->getArticleID(), "rc_type" => RC_NEW) ) )
+ {
+ #Open a master connection for update rc table
+ $dbw = wfGetDB( DB_MASTER );
+ $dbw->begin();
+ #Update row
+ $dbw->update('recentchanges', array( 'rc_title' => $nt->getDBkey(), 'rc_namespace' => $nt->getNamespace()), array( 'rc_id' => $rc_id) );
+ $dbw->commit();
+ }
+ }
}
# Initialises the members of this object from a mysql row object

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5018
Default Alt Text
bugfix_17536_recentchanges.diff (1 KB)

Event Timeline