Moved addAutopromoteOnceGroups() call to a deferred update
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 21 May 2015 07:03:56 +0000 (00:03 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 30 May 2015 04:47:46 +0000 (04:47 +0000)
Change-Id: If7941465889c1848ccf1be4ff5505c5eb53a14f1

includes/page/WikiPage.php

index 5e4438a..8e2e8a5 100644 (file)
@@ -1961,13 +1961,13 @@ class WikiPage implements Page, IDBAccessObject {
                $status->value['revision'] = $revision;
 
                $hook_args = array( &$this, &$user, $content, $summary,
-                                                       $flags & EDIT_MINOR, null, null, &$flags, $revision, &$status, $baseRevId );
+                       $flags & EDIT_MINOR, null, null, &$flags, $revision, &$status, $baseRevId );
 
                ContentHandler::runLegacyHooks( 'ArticleSaveComplete', $hook_args );
                Hooks::run( 'PageContentSaveComplete', $hook_args );
 
                // Promote user to any groups they meet the criteria for
-               $dbw->onTransactionIdle( function () use ( $user ) {
+               DeferredUpdates::addCallableUpdate( function () use ( $user ) {
                        $user->addAutopromoteOnceGroups( 'onEdit' );
                        $user->addAutopromoteOnceGroups( 'onView' ); // b/c
                } );