Merge "deferred: make DeferredUpdates::attemptUpdate() use callback owners for $fname...
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index 173fdc6..8cc5a39 100644 (file)
@@ -1063,6 +1063,7 @@ class WikiPage implements Page, IDBAccessObject {
         * Insert or update the redirect table entry for this page to indicate it redirects to $rt
         * @param Title $rt Redirect target
         * @param int|null $oldLatest Prior page_latest for check and set
+        * @return bool Success
         */
        public function insertRedirectEntry( Title $rt, $oldLatest = null ) {
                $dbw = wfGetDB( DB_MASTER );
@@ -1089,9 +1090,14 @@ class WikiPage implements Page, IDBAccessObject {
                                ],
                                __METHOD__
                        );
+                       $success = true;
+               } else {
+                       $success = false;
                }
 
                $dbw->endAtomic( __METHOD__ );
+
+               return $success;
        }
 
        /**
@@ -1461,18 +1467,19 @@ class WikiPage implements Page, IDBAccessObject {
                }
 
                if ( $isRedirect ) {
-                       $this->insertRedirectEntry( $redirectTitle );
+                       $success = $this->insertRedirectEntry( $redirectTitle );
                } else {
                        // This is not a redirect, remove row from redirect table
                        $where = [ 'rd_from' => $this->getId() ];
                        $dbw->delete( 'redirect', $where, __METHOD__ );
+                       $success = true;
                }
 
                if ( $this->getTitle()->getNamespace() == NS_FILE ) {
                        RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $this->getTitle() );
                }
 
-               return ( $dbw->affectedRows() != 0 );
+               return $success;
        }
 
        /**
@@ -3503,7 +3510,7 @@ class WikiPage implements Page, IDBAccessObject {
                self::purgeInterwikiCheckKey( $title );
        }
 
-       /**#@-*/
+       /** #@- */
 
        /**
         * Purge the check key for cross-wiki cache entries referencing this page