From a62f1650134233928e614c547e511506f80eeb53 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 6 Nov 2015 16:15:34 -0800 Subject: [PATCH] Always defer the log publish() in recordUpload2 This is more performant and simplifies the code a bit. Change-Id: I7a30e000ae4eff47519b83eb6bdde57eeb8a18f6 --- includes/filerepo/file/LocalFile.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index cd64f0d127..12d400758c 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -1365,8 +1365,6 @@ class LocalFile extends File { $logId = $logEntry->insert(); if ( $descTitle->exists() ) { - // Page exists, do RC entry now (otherwise we wait for later) - $logEntry->publish( $logId ); // Use own context to get the action text in content language $formatter = LogFormatter::newFromEntry( $logEntry ); $formatter->setContext( RequestContext::newExtraneousContext( $descTitle ) ); @@ -1407,6 +1405,8 @@ class LocalFile extends File { ) { # Update memcache after the commit $that->invalidateCache(); + # Page exists, do RC entry now (otherwise we wait for later) + $logEntry->publish( $logId ); if ( $newPageContent ) { # New file page; create the description page. @@ -1423,7 +1423,6 @@ class LocalFile extends File { // Now that the page exists, make an RC entry. // This relies on the resetArticleID() call in WikiPage::insertOn(), // which is triggered on $descTitle by doEditContent() above. - $logEntry->publish( $logId ); if ( isset( $status->value['revision'] ) ) { /** @var $rev Revision */ $rev = $status->value['revision']; -- 2.20.1