From 630e6a32e7b4a8725be64bdafa794d1329a30a04 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 28 Feb 2008 00:47:00 +0000 Subject: [PATCH] * (bug 13130) Moved edit token and autosummary fields above edit tools to reduce broken form submissions --- RELEASE-NOTES | 2 ++ includes/EditPage.php | 54 +++++++++++++++++++++---------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 526e101eee..3d3123b6ed 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -37,6 +37,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13100) Added 'preloadtitle' parameter to action=edit§ion=new that pre-fills the section title field. * (bug 13112) Added Special:RelatedChanges alias to Special:Recentchangeslinked +* (bug 13130) Moved edit token and autosummary fields above edit tools to + reduce broken form submissions === Bug fixes in 1.13 === diff --git a/includes/EditPage.php b/includes/EditPage.php index badb695df1..3c964dd1c3 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1229,14 +1229,26 @@ class EditPage { # if this is a comment, show a subject line at the top, which is also the edit summary. # Otherwise, show a summary field at the bottom $summarytext = htmlspecialchars( $wgContLang->recodeForEdit( $this->summary ) ); # FIXME + + # If a blank edit summary was previously provided, and the appropriate + # user preference is active, pass a hidden tag as wpIgnoreBlankSummary. This will stop the + # user being bounced back more than once in the event that a summary + # is not required. + ##### + # For a bit more sophisticated detection of blank summaries, hash the + # automatic one and pass that in the hidden field wpAutoSummary. + $summaryhiddens = ''; + if( $this->missingSummary ) $summaryhiddens .= wfHidden( 'wpIgnoreBlankSummary', true ); + $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); + $summaryhiddens .= wfHidden( 'wpAutoSummary', $autosumm ); if( $this->section == 'new' ) { - $commentsubject="\n
\n
"; + $commentsubject="\n
\n{$summaryhiddens}
"; $editsummary = ''; $subjectpreview = $summarytext && $this->preview ? "
".wfMsg('subject-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."
\n" : ''; $summarypreview = ''; } else { $commentsubject = ''; - $editsummary="\n
\n
"; + $editsummary="\n
\n{$summaryhiddens}
"; $summarypreview = $summarytext && $this->preview ? "
".wfMsg('summary-preview').':'.$sk->commentBlock( $this->summary, $this->mTitle )."
\n" : ''; $subjectpreview = ''; } @@ -1339,21 +1351,6 @@ END
"); - $wgOut->addHtml( '
' ); - $wgOut->addWikiMsgArray( 'edittools', array(), array( 'content' ) ); - $wgOut->addHtml( '
' ); - - $wgOut->addHTML( $this->editFormTextAfterTools ); - - $wgOut->addHTML( " -
-{$formattedtemplates} -
-
-{$formattedhiddencats} -
-"); - /** * To make it harder for someone to slip a user a page * which submits an edit form to the wiki without their @@ -1369,19 +1366,20 @@ END $token = htmlspecialchars( $wgUser->editToken() ); $wgOut->addHTML( "\n\n" ); + $wgOut->addHtml( '
' ); + $wgOut->addWikiMsgArray( 'edittools', array(), array( 'content' ) ); + $wgOut->addHtml( '
' ); - # If a blank edit summary was previously provided, and the appropriate - # user preference is active, pass a hidden tag here. This will stop the - # user being bounced back more than once in the event that a summary - # is not required. - if( $this->missingSummary ) { - $wgOut->addHTML( "\n" ); - } + $wgOut->addHTML( $this->editFormTextAfterTools ); - # For a bit more sophisticated detection of blank summaries, hash the - # automatic one and pass that in a hidden field. - $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); - $wgOut->addHtml( wfHidden( 'wpAutoSummary', $autosumm ) ); + $wgOut->addHTML( " +
+{$formattedtemplates} +
+
+{$formattedhiddencats} +
+"); if ( $this->isConflict ) { $wgOut->wrapWikiMsg( '==$1==', "yourdiff" ); -- 2.20.1