Merge "Made WikiPage::isRedirect() actually use page_is_redirect"
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index 2fde832..d3978ea 100644 (file)
@@ -469,12 +469,11 @@ class WikiPage implements Page, IDBAccessObject {
         * @return bool
         */
        public function isRedirect() {
-               $content = $this->getContent();
-               if ( !$content ) {
-                       return false;
+               if ( !$this->mDataLoaded ) {
+                       $this->loadPageData();
                }
 
-               return $content->isRedirect();
+               return (bool)$this->mIsRedirect;
        }
 
        /**
@@ -2931,12 +2930,15 @@ class WikiPage implements Page, IDBAccessObject {
         *   may already return null when the page proper was deleted.
         */
        public function doDeleteUpdates( $id, Content $content = null ) {
-               // update site status
+               // Update site status
                DeferredUpdates::addUpdate( new SiteStatsUpdate( 0, 1, - (int)$this->isCountable(), -1 ) );
 
-               // remove secondary indexes, etc
+               // Delete pagelinks, update secondary indexes, etc
                $updates = $this->getDeletionUpdates( $content );
-               DataUpdate::runUpdates( $updates, 'enqueue' );
+               // Make sure an enqueued jobs run after commit so they see the deletion
+               wfGetDB( DB_MASTER )->onTransactionIdle( function() use ( $updates ) {
+                       DataUpdate::runUpdates( $updates, 'enqueue' );
+               } );
 
                // Reparse any pages transcluding this page
                LinksUpdate::queueRecursiveJobsForTable( $this->mTitle, 'templatelinks' );