Merge "Use current preference overriding for live preview"
[lhc/web/wiklou.git] / includes / WikiPage.php
index 8c035aa..a191983 100644 (file)
@@ -2923,27 +2923,6 @@ class WikiPage implements Page, IDBAccessObject {
                        return array( array( 'notvisiblerev' ) );
                }
 
-               $set = array();
-               if ( $bot && $guser->isAllowed( 'markbotedits' ) ) {
-                       // Mark all reverted edits as bot
-                       $set['rc_bot'] = 1;
-               }
-
-               if ( $wgUseRCPatrol ) {
-                       // Mark all reverted edits as patrolled
-                       $set['rc_patrolled'] = 1;
-               }
-
-               if ( count( $set ) ) {
-                       $dbw->update( 'recentchanges', $set,
-                               array( /* WHERE */
-                                       'rc_cur_id' => $current->getPage(),
-                                       'rc_user_text' => $current->getUserText(),
-                                       'rc_timestamp > ' . $dbw->addQuotes( $s->rev_timestamp ),
-                               ), __METHOD__
-                       );
-               }
-
                // Generate the edit summary if necessary
                $target = Revision::newFromId( $s->rev_id );
                if ( empty( $summary ) ) {
@@ -2990,6 +2969,27 @@ class WikiPage implements Page, IDBAccessObject {
                        return $status->getErrorsArray();
                }
 
+               $set = array();
+               if ( $bot && $guser->isAllowed( 'markbotedits' ) ) {
+                       // Mark all reverted edits as bot
+                       $set['rc_bot'] = 1;
+               }
+
+               if ( $wgUseRCPatrol ) {
+                       // Mark all reverted edits as patrolled
+                       $set['rc_patrolled'] = 1;
+               }
+
+               if ( count( $set ) ) {
+                       $dbw->update( 'recentchanges', $set,
+                               array( /* WHERE */
+                                       'rc_cur_id' => $current->getPage(),
+                                       'rc_user_text' => $current->getUserText(),
+                                       'rc_timestamp > ' . $dbw->addQuotes( $s->rev_timestamp ),
+                               ), __METHOD__
+                       );
+               }
+
                if ( !empty( $status->value['revision'] ) ) {
                        $revId = $status->value['revision']->getId();
                } else {
@@ -3334,22 +3334,6 @@ class WikiPage implements Page, IDBAccessObject {
                return $this->mTitle->getTemplateLinksFrom();
        }
 
-       /**
-        * Perform article updates on a special page creation.
-        *
-        * @param $rev Revision object
-        *
-        * @todo This is a shitty interface function. Kill it and replace the
-        * other shitty functions like doEditUpdates and such so it's not needed
-        * anymore.
-        * @deprecated since 1.18, use doEditUpdates()
-        */
-       public function createUpdates( $rev ) {
-               wfDeprecated( __METHOD__, '1.18' );
-               global $wgUser;
-               $this->doEditUpdates( $rev, $wgUser, array( 'created' => true ) );
-       }
-
        /**
         * This function is called right before saving the wikitext,
         * so we can do things like signatures and links-in-context.
@@ -3624,12 +3608,12 @@ class PoolWorkArticleView extends PoolCounterWork {
                $this->parserOutput = ParserCache::singleton()->getDirty( $this->page, $this->parserOptions );
 
                if ( $this->parserOutput === false ) {
-                       wfDebugLog( 'dirty', "dirty missing\n" );
+                       wfDebugLog( 'dirty', 'dirty missing' );
                        wfDebug( __METHOD__ . ": no dirty cache\n" );
                        return false;
                } else {
                        wfDebug( __METHOD__ . ": sending dirty output\n" );
-                       wfDebugLog( 'dirty', "dirty output {$this->cacheKey}\n" );
+                       wfDebugLog( 'dirty', "dirty output {$this->cacheKey}" );
                        $this->isDirty = true;
                        return true;
                }