From: Tim Starling Date: Thu, 5 May 2016 05:56:24 +0000 (+1000) Subject: Don't stash on preview if $wgAjaxEditStash=false X-Git-Tag: 1.31.0-rc.0~7088^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=092d20be71e50cb014aa00624c2782327a919f46;p=lhc%2Fweb%2Fwiklou.git 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 --- 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();