From: Roan Kattouw Date: Tue, 26 Aug 2008 20:49:52 +0000 (+0000) Subject: API: Fixed bug that caused all action=edit requests to return with the nochange flag... X-Git-Tag: 1.31.0-rc.0~45640 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=db6744da16692cac1e68d2c6f41bb051cf82be5a;p=lhc%2Fweb%2Fwiklou.git API: Fixed bug that caused all action=edit requests to return with the nochange flag set on wikis where DB_MASTER != DB_SLAVE --- 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