API: Fixed bug that caused all action=edit requests to return with the nochange flag...
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 26 Aug 2008 20:49:52 +0000 (20:49 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 26 Aug 2008 20:49:52 +0000 (20:49 +0000)
RELEASE-NOTES
includes/api/ApiEditPage.php

index 8d79e71..1de3727 100644 (file)
@@ -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 ===
 
index 56416d8..aaa2559 100644 (file)
@@ -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