Move down $logEntry publish() call in recordUpload2()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 12 Nov 2015 03:36:13 +0000 (19:36 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 12 Nov 2015 03:36:16 +0000 (19:36 -0800)
This was moved before the defered doEditContent() call
for new pages by mistake.

Bug: T118433
Change-Id: I007acf82622ec6d68c007921f632793392025f40

includes/filerepo/file/LocalFile.php

index 1a33538..c2bbb4e 100644 (file)
@@ -1404,8 +1404,6 @@ 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.
@@ -1419,7 +1417,6 @@ class LocalFile extends File {
                                        $user
                                );
 
-                               // 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.
                                if ( isset( $status->value['revision'] ) ) {
@@ -1438,6 +1435,8 @@ class LocalFile extends File {
                                $wikiPage->getTitle()->purgeSquid();
                        }
 
+                       # Now that the page exists, make an RC entry.
+                       $logEntry->publish( $logId );
                        # Run hook for other updates (typically more cache purging)
                        Hooks::run( 'FileUpload', array( $that, $reupload, !$newPageContent ) );