jenkins-bot has submitted this change and it was merged.

Change subject: Always defer the log publish() in recordUpload2
......................................................................


Always defer the log publish() in recordUpload2

This is more performant and simplifies the code a bit.

Change-Id: I7a30e000ae4eff47519b83eb6bdde57eeb8a18f6
---
M includes/filerepo/file/LocalFile.php
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/filerepo/file/LocalFile.php 
b/includes/filerepo/file/LocalFile.php
index cd64f0d..12d4007 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -1365,8 +1365,6 @@
                $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 @@
                ) {
                        # 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 @@
                                // 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'];

-- 
To view, visit https://gerrit.wikimedia.org/r/251670
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7a30e000ae4eff47519b83eb6bdde57eeb8a18f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to