From: mrbluesky Date: Thu, 9 Feb 2012 21:06:19 +0000 (+0000) Subject: (bug 17416) Don't prompt for summary when summary is preset using &summary= X-Git-Tag: 1.31.0-rc.0~24814 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=af38b9bf09d14f1756f5d98c43f061c5ab76956d;p=lhc%2Fweb%2Fwiklou.git (bug 17416) Don't prompt for summary when summary is preset using &summary= --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 466b8df9df..25ebc3c078 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -182,6 +182,12 @@ class EditPage { * @var ParserOutput */ var $mParserOutput; + + /** + * Has a summary been preset using GET parameter &summary= ? + * @var Bool + */ + var $hasPresetSummary = false; var $mBaseRevision = false; var $mShowSummaryField = true; @@ -679,6 +685,9 @@ class EditPage { } elseif ( $this->section != 'new' && $request->getVal( 'summary' ) ) { $this->summary = $request->getText( 'summary' ); + if ( $this->summary !== '' ) { + $this->hasPresetSummary = true; + } } if ( $request->getVal( 'minor' ) ) { @@ -1795,6 +1804,13 @@ class EditPage { $wgOut->addHTML( Html::hidden( 'wpIgnoreBlankSummary', true ) ); } + if ( $this->hasPresetSummary ) { + // If a summary has been preset using &summary= we dont want to prompt for + // a different summary. Only prompt for a summary if the summary is blanked. + // (Bug 17416) + $this->autoSumm = 'd41d8cd98f00b204e9800998ecf8427e'; # == md5('') + } + $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); $wgOut->addHTML( Html::hidden( 'wpAutoSummary', $autosumm ) );