Merge "Use current preference overriding for live preview"
[lhc/web/wiklou.git] / includes / WikiPage.php
index 5fc5a38..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 {
@@ -3608,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;
                }