From db6744da16692cac1e68d2c6f41bb051cf82be5a Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 26 Aug 2008 20:49:52 +0000 Subject: [PATCH] API: Fixed bug that caused all action=edit requests to return with the nochange flag set on wikis where DB_MASTER != DB_SLAVE --- RELEASE-NOTES | 2 ++ includes/api/ApiEditPage.php | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 8d79e711b4..1de37273f6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -178,6 +178,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 15275) apprefix and related parameters ignore spaces at the end * action=edit no longer throws unknown error 228 when trying to create an empty section with section=new +* Database replication lag doesn't cause all action=edit requests to return the + nochange flag any more === Languages updated in 1.14 === diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 56416d8695..aaa25590b6 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -212,7 +212,12 @@ class ApiEditPage extends ApiBase { $r['result'] = "Success"; $r['pageid'] = $titleObj->getArticleID(); $r['title'] = $titleObj->getPrefixedText(); - $newRevId = $titleObj->getLatestRevId(); + # HACK: We create a new Article object here because getRevIdFetched() + # refuses to be run twice, and because Title::getLatestRevId() + # won't fetch from the master unless we select for update, which we + # don't want to do. + $newArticle = new Article($titleObj); + $newRevId = $newArticle->getRevIdFetched(); if($newRevId == $oldRevId) $r['nochange'] = ''; else -- 2.20.1