From: Aaron Schulz Date: Tue, 12 Jan 2016 21:23:39 +0000 (-0800) Subject: Make AjaxDispatcher commit transactions before responding X-Git-Tag: 1.31.0-rc.0~8355^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/message.php?a=commitdiff_plain;h=032bed0c2f7e84f36c002c2265edb325763b8d5b;p=lhc%2Fweb%2Fwiklou.git Make AjaxDispatcher commit transactions before responding Some extension code appears to have sanity commit() calls to work around this in places, which is the wrong solution. Note that there was always the post-send commit, just not the pre-send one that normal requests have. Change-Id: I410a1f1097daa4f43481d1b0afbe7f467b86d254 --- diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 96892d710f..c2ea582e63 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -135,6 +135,9 @@ class AjaxDispatcher { $result = new AjaxResponse( $result ); } + // Make sure DB commit succeeds before sending a response + wfGetLBFactory()->commitMasterChanges( __METHOD__ ); + $result->sendHeaders(); $result->printText();