The fallback to master makes sense in Revision::newFromId(), since a
revision ID known to exist by some other means might be present in the
master but not in the slave. But it doesn't make sense for
Revision::newFromTitle(), where by far the most common cause of this
case being hit is the page being nonexistent.
Change-Id: I41189fcde1b8065ac134982241376d63b78732a1
if ( $id ) {
// Use the specified ID
$conds['rev_id'] = $id;
+ return self::newFromConds( $conds, (int)$flags );
} else {
// Use a join to get the latest revision
$conds[] = 'rev_id=page_latest';
+ $db = wfGetDB( ( $flags & self::READ_LATEST ) ? DB_MASTER : DB_SLAVE );
+ return self::loadFromConds( $db, $conds, $flags );
}
- return self::newFromConds( $conds, (int)$flags );
}
/**