Check $wgAjaxEditStash before using cached edits.
authordaniel <daniel.kinzler@wikimedia.de>
Fri, 9 Jan 2015 14:18:14 +0000 (14:18 +0000)
committerOri.livneh <ori@wikimedia.org>
Fri, 9 Jan 2015 18:40:24 +0000 (18:40 +0000)
Without this, stale data from the cache may still be used
even after $wgAjaxEditStash was disabled.

This is important mainly during testing, when a reliable way
to toggle stashing is needed to investigate issues that may
be related to the stashing mechanism.

Change-Id: Ib9ff68b43763e3857d1a28e34b48439d78c1ed5c

includes/page/WikiPage.php

index fa54f7c..0eeab1c 100644 (file)
@@ -2041,7 +2041,7 @@ class WikiPage implements Page, IDBAccessObject {
        public function prepareContentForEdit(
                Content $content, $revid = null, User $user = null, $serialFormat = null, $useCache = true
        ) {
-               global $wgContLang, $wgUser;
+               global $wgContLang, $wgUser, $wgAjaxEditStash;
 
                $user = is_null( $user ) ? $wgUser : $user;
                //XXX: check $user->getId() here???
@@ -2063,7 +2063,7 @@ class WikiPage implements Page, IDBAccessObject {
                }
 
                // The edit may have already been prepared via api.php?action=stashedit
-               $cachedEdit = $useCache
+               $cachedEdit = $useCache && $wgAjaxEditStash
                        ? ApiStashEdit::checkCache( $this->getTitle(), $content, $user )
                        : false;