From 092d20be71e50cb014aa00624c2782327a919f46 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 5 May 2016 15:56:24 +1000 Subject: [PATCH] Don't stash on preview if $wgAjaxEditStash=false Since WikiPage won't check the cache, there's no point in storing it. Also, this allows the feature to be completely disabled for debugging etc. Change-Id: Ibc00e4b20f17091b097a51877123ab9f62fd7f2a --- includes/EditPage.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 9112112876..02093fffff 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3596,7 +3596,7 @@ HTML */ function getPreviewText() { global $wgOut, $wgUser, $wgRawHtml, $wgLang; - global $wgAllowUserCss, $wgAllowUserJs; + global $wgAllowUserCss, $wgAllowUserJs, $wgAjaxEditStash; $stats = $wgOut->getContext()->getStats(); @@ -3708,10 +3708,12 @@ HTML # Try to stash the edit for the final submission step # @todo: different date format preferences cause cache misses - ApiStashEdit::stashEditFromPreview( - $this->getArticle(), $content, $pstContent, - $parserOutput, $parserOptions, $parserOptions, wfTimestampNow() - ); + if ( $wgAjaxEditStash ) { + ApiStashEdit::stashEditFromPreview( + $this->getArticle(), $content, $pstContent, + $parserOutput, $parserOptions, $parserOptions, wfTimestampNow() + ); + } $parserOutput->setEditSectionTokens( false ); // no section edit links $previewHTML = $parserOutput->getText(); -- 2.20.1