Merge "Don't check namespace in SpecialWantedtemplates"
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index b129bd2..69b675b 100644 (file)
@@ -1199,10 +1199,9 @@ class WikiPage implements Page, IDBAccessObject {
         * Best if all done inside a transaction.
         *
         * @param DatabaseBase $dbw
-        * @return int The newly created page_id key, or false if the title already existed
+        * @return int|bool The newly created page_id key; false if the title already existed
         */
        public function insertOn( $dbw ) {
-
                $page_id = $dbw->nextSequenceValue( 'page_page_id_seq' );
                $dbw->insert( 'page', array(
                        'page_id'           => $page_id,
@@ -1223,9 +1222,11 @@ class WikiPage implements Page, IDBAccessObject {
                        $newid = $dbw->insertId();
                        $this->mId = $newid;
                        $this->mTitle->resetArticleID( $newid );
-               }
 
-               return $affected ? $newid : false;
+                       return $newid;
+               } else {
+                       return false;
+               }
        }
 
        /**
@@ -2853,7 +2854,7 @@ class WikiPage implements Page, IDBAccessObject {
                // Clone the title, so we have the information we need when we log
                $logTitle = clone $this->mTitle;
 
-               // Log the deletion, if the page was suppressed, log it at Oversight instead
+               // Log the deletion, if the page was suppressed, put it in the suppression log instead
                $logtype = $suppress ? 'suppress' : 'delete';
 
                $logEntry = new ManualLogEntry( $logtype, 'delete' );
@@ -3224,10 +3225,10 @@ class WikiPage implements Page, IDBAccessObject {
 
                // Purge squid for this page only
                $title->purgeSquid();
-
-               $revid = $revision ? $revision->getId() : null;
                // Clear file cache for this page only
                HTMLFileCache::clearFileCache( $title );
+
+               $revid = $revision ? $revision->getId() : null;
                DeferredUpdates::addCallableUpdate( function() use ( $title, $revid ) {
                        InfoAction::invalidateCache( $title, $revid );
                } );