* (bug 5286) Fix regression in display of missing/bad revision IDs
* (bug 4729) Add user preference that marks a user's edits as patrolled if user is able to
* (bug 4497,4704,5010) Added some new language codes.
+* (bug 4630) Add user preference to prompt users when entering blank edit summaries
=== Caveats ===
var $tooBig = false;
var $kblength = false;
var $missingComment = false;
+ var $missingSummary = false;
+ var $allowBlankSummary = false;
# Form values
var $save = false, $preview = false, $diff = false;
$this->minoredit = $request->getCheck( 'wpMinoredit' );
$this->watchthis = $request->getCheck( 'wpWatchthis' );
+ $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' );
+
} else {
# Not a posted form? Start with nothing.
wfDebug( "$fname: Not a posted form.\n" );
return true;
}
+ # Handle the user preference to force summaries here
+ if( trim( $this->summary ) == '' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary' ) ) {
+ $this->missingSummary = true;
+ wfProfileOut( $fname );
+ return( true );
+ }
+
# All's well
wfProfileIn( "$fname-sectionanchor" );
$sectionanchor = '';
if ( $this->missingComment ) {
$wgOut->addWikiText( wfMsg( 'missingcommenttext' ) );
}
+
+ if( $this->missingSummary ) {
+ $wgOut->addWikiText( wfMsg( 'missingsummary' ) );
+ }
if ( !$this->checkUnicodeCompliantBrowser() ) {
$wgOut->addWikiText( wfMsg( 'nonunicodebrowser') );
$wgOut->addHTML( "\n<input type='hidden' value=\"$token\" name=\"wpEditToken\" />\n" );
}
+ # If there's no summary, slip in a hidden tag here
+ # If the user doesn't want to provide one, hitting Save a second time will cause it to go
+ # through without further hassle
+ if( $this->missingSummary ) {
+ $wgOut->addHTML( "<input type=\"hidden\" name=\"wpIgnoreBlankSummary\" value=\"1\" />\n" );
+ }
if ( $this->isConflict ) {
require_once( "DifferenceEngine.php" );
'externaleditor',
'externaldiff',
$wgLivePreview ? 'uselivepreview' : false,
- $wgUser->isAllowed( 'patrol' ) ? 'autopatrol' : false, )
- ) . '</fieldset>'
+ $wgUser->isAllowed( 'patrol' ) ? 'autopatrol' : false,
+ 'forceeditsummary',
+ ) ) . '</fieldset>'
);
$this->mUsedToggles['autopatrol'] = true; # Don't show this up for users who can't; the handler below is dumb and doesn't know it
'tog-showjumplinks' => 'Enable "jump to" accessibility links',
'tog-uselivepreview' => 'Use live preview (JavaScript) (Experimental)',
'tog-autopatrol' => 'Mark edits you make as patrolled',
+'tog-forceeditsummary' => 'Prompt me when entering a blank edit summary',
'underline-always' => 'Always',
'underline-never' => 'Never',
'showlivepreview' => 'Live preview',
'showdiff' => 'Show changes',
'anoneditwarning' => 'You are not logged in. Your IP address will be recorded in this page\'s edit history.',
+'missingsummary' => "'''Reminder:''' You have not provided an edit summary. If you click Save again, your edit will be saved without one.",
'missingcommenttext' => 'Please enter a comment below.',
'blockedtitle' => 'User is blocked',
'blockedtext' => 'Your user name or IP address has been blocked by $1.