Fallback to read from master in DifferenceEngine::loadRevisionData
In DifferenceEngine we need to show a diff immediately after
an edit happened if someone did a rollback. To make that work
again, try loading a revision from master if we have more than
one database servers and we failed loading the revision from
a slave.
Change-Id: I08a16faa9e637c614c6d2fc9a10536c7b41685a8
Follows: 3c2bc32ae1
Bug: T93866
This commit is contained in:
parent
2b6eb60ce5
commit
8624e261f0
1 changed files with 6 additions and 0 deletions
|
|
@ -1233,6 +1233,12 @@ class DifferenceEngine extends ContextSource {
|
||||||
// Load the new revision object
|
// Load the new revision object
|
||||||
if ( $this->mNewid ) {
|
if ( $this->mNewid ) {
|
||||||
$this->mNewRev = Revision::newFromId( $this->mNewid );
|
$this->mNewRev = Revision::newFromId( $this->mNewid );
|
||||||
|
|
||||||
|
if ( !$this->mNewRev && wfGetLB()->getServerCount() > 1 ) {
|
||||||
|
// Try harder… This is being hit after a rollback where we show the
|
||||||
|
// diff immediately after the edit happened. T93866
|
||||||
|
$this->mNewRev = Revision::newFromId( $this->mNewid, Revision::READ_LATEST );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->mNewRev = Revision::newFromTitle(
|
$this->mNewRev = Revision::newFromTitle(
|
||||||
$this->getTitle(),
|
$this->getTitle(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue