* Moved up isCountable() call, since insertOn() sets the page ID, it safer to do this call first. It now uses master DB data, as it should for reads to write data. Furthermore, calling it after insertOn() was triggered loadPageData() on a slave, breaking the page ID cache just set in insertOn().
* Preemptively call loadPageData( 'fromdbmaster' ) as Article::doEdit() does (r98880) to avoid any lazy loading from the slave which can corrupt the page ID cache.
# Does this page already exist? We'll have to update it...
$article = new Article( $this->title );
+ # Load latest data for the current page (bug 31179)
+ $article->loadPageData( 'fromdbmaster' );
+ $oldcountable = $article->isCountable();
+
$options = 'FOR UPDATE'; // lock page
$page = $dbw->selectRow( 'page',
array( 'page_id', 'page_latest' ),
}
$created = (bool)$newid;
- $oldcountable = $article->isCountable();
// Attach the latest revision to the page...
$wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId );