Merge "Remove unused 'XMPGetInfo' and 'XMPGetResults' hooks"
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index 64dd99d..5e4438a 100644 (file)
@@ -1835,17 +1835,13 @@ class WikiPage implements Page, IDBAccessObject {
                                if ( !( $flags & EDIT_SUPPRESS_RC ) ) {
                                        // Mark as patrolled if the user can do so
                                        $patrolled = $wgUseRCPatrol && !count(
-                                       $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
+                                               $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
                                        // Add RC row to the DB
-                                       $rc = RecentChange::notifyEdit( $now, $this->mTitle, $isminor, $user, $summary,
+                                       RecentChange::notifyEdit(
+                                               $now, $this->mTitle, $isminor, $user, $summary,
                                                $oldid, $this->getTimestamp(), $bot, '', $oldsize, $newsize,
                                                $revisionId, $patrolled
                                        );
-
-                                       // Log auto-patrolled edits
-                                       if ( $patrolled ) {
-                                               PatrolLog::record( $rc, true, $user );
-                                       }
                                }
 
                                $user->incEditCount();
@@ -1936,13 +1932,10 @@ class WikiPage implements Page, IDBAccessObject {
                                $patrolled = ( $wgUseRCPatrol || $wgUseNPPatrol ) && !count(
                                        $this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
                                // Add RC row to the DB
-                               $rc = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $user, $summary, $bot,
-                                       '', $newsize, $revisionId, $patrolled );
-
-                               // Log auto-patrolled edits
-                               if ( $patrolled ) {
-                                       PatrolLog::record( $rc, true, $user );
-                               }
+                               RecentChange::notifyNew(
+                                       $now, $this->mTitle, $isminor, $user, $summary, $bot,
+                                       '', $newsize, $revisionId, $patrolled
+                               );
                        }
 
                        $user->incEditCount();
@@ -2193,20 +2186,18 @@ class WikiPage implements Page, IDBAccessObject {
                        $recursive = $options['changed']; // bug 50785
                        $updates = $content->getSecondaryDataUpdates(
                                $this->getTitle(), null, $recursive, $editInfo->output );
-                       DataUpdate::runUpdates( $updates );
+                       foreach ( $updates as $update ) {
+                               DeferredUpdates::addUpdate( $update );
+                       }
                }
 
                Hooks::run( 'ArticleEditUpdates', array( &$this, &$editInfo, $options['changed'] ) );
 
                if ( Hooks::run( 'ArticleEditUpdatesDeleteFromRecentchanges', array( &$this ) ) ) {
-                       // Update the cached list of active users
-                       $jobs = array( RecentChangesUpdateJob::newCacheUpdateJob() );
                        // Flush old entries from the `recentchanges` table
                        if ( mt_rand( 0, 9 ) == 0 ) {
-                               $jobs[] = RecentChangesUpdateJob::newPurgeJob();
+                               JobQueueGroup::singleton()->lazyPush( RecentChangesUpdateJob::newPurgeJob() );
                        }
-
-                       JobQueueGroup::singleton()->lazyPush( $jobs );
                }
 
                if ( !$this->exists() ) {
@@ -2275,7 +2266,6 @@ class WikiPage implements Page, IDBAccessObject {
                } elseif ( $options['changed'] ) { // bug 50785
                        self::onArticleEdit( $this->mTitle );
                }
-
        }
 
        /**