From 005ae515d0c3837652a2486dc21c720aff46e3c0 Mon Sep 17 00:00:00 2001 From: Lupin Date: Wed, 1 Mar 2006 23:00:07 +0000 Subject: [PATCH] Patch for bug 4273: "New section" editing page should not submit when user hits Enter in Summary field. --- includes/EditPage.php | 10 ++++++++++ languages/Messages.php | 1 + 2 files changed, 11 insertions(+) diff --git a/includes/EditPage.php b/includes/EditPage.php index 46d9e8d76c..e15dc15c12 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -26,6 +26,7 @@ class EditPage { var $mTokenOk = true; var $tooBig = false; var $kblength = false; + var $missingComment = false; # Form values var $save = false, $preview = false, $diff = false; @@ -630,6 +631,10 @@ class EditPage { wfProfileIn( "$fname-sectionanchor" ); $sectionanchor = ''; if( $this->section == 'new' ) { + if ( $this->textbox1 == '' ) { + $this->missingComment = true; + return true; + } if( $this->summary != '' ) { $sectionanchor = $this->sectionAnchor( $this->summary ); } @@ -735,6 +740,11 @@ class EditPage { $s = wfMsg( 'editing', $this->mTitle->getPrefixedText() ); } $wgOut->setPageTitle( $s ); + + if ( $this->missingComment ) { + $wgOut->addWikiText( wfMsg( 'missingcommenttext' ) ); + } + if ( !$this->checkUnicodeCompliantBrowser() ) { $wgOut->addWikiText( wfMsg( 'nonunicodebrowser') ); } diff --git a/languages/Messages.php b/languages/Messages.php index 6f8bb15699..924168b51a 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -453,6 +453,7 @@ format. Please enter a well-formatted address or empty that field.', 'showlivepreview' => 'Live preview', 'showdiff' => 'Show changes', 'anoneditwarning' => 'You are not logged in. Your IP address will be recorded in this page\'s edit history.', +'missingcommenttext' => 'Please enter a comment below.', 'blockedtitle' => 'User is blocked', 'blockedtext' => 'Your user name or IP address has been blocked by $1. The reason given is this:
\'\'$2\'\'

You may contact $1 or one of the other -- 2.20.1