* @return bool
*/
public function isRedirect() {
- $content = $this->getContent();
- if ( !$content ) {
- return false;
+ if ( !$this->mDataLoaded ) {
+ $this->loadPageData();
}
- return $content->isRedirect();
+ return (bool)$this->mIsRedirect;
}
/**
* 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' );