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
public function prepareContentForEdit(
Content $content, $revid = null, User $user = null, $serialFormat = null, $useCache = true
) {
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???
$user = is_null( $user ) ? $wgUser : $user;
//XXX: check $user->getId() here???
}
// The edit may have already been prepared via api.php?action=stashedit
}
// The edit may have already been prepared via api.php?action=stashedit
- $cachedEdit = $useCache
+ $cachedEdit = $useCache && $wgAjaxEditStash
? ApiStashEdit::checkCache( $this->getTitle(), $content, $user )
: false;
? ApiStashEdit::checkCache( $this->getTitle(), $content, $user )
: false;