Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7785
27860
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 11:33 PM
2014-11-21 23:33:44 (UTC+0)
Size
3 KB
Referenced Files
None
Subscribers
None
27860
View Options
Index: includes/EditPage.php
===================================================================
--- includes/EditPage.php (revision 86761)
+++ includes/EditPage.php (working copy)
@@ -57,6 +57,7 @@
var $isCssJsSubpage = false;
var $isCssSubpage = false;
var $isJsSubpage = false;
+ var $isNew = false; // new page or new section
var $deletedSinceEdit;
var $formtype;
var $firsttime;
@@ -415,10 +416,11 @@
$this->isConflict = false;
// css / js subpages of user pages get a special treatment
- $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
- $this->isCssSubpage = $this->mTitle->isCssSubpage();
- $this->isJsSubpage = $this->mTitle->isJsSubpage();
+ $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
+ $this->isCssSubpage = $this->mTitle->isCssSubpage();
+ $this->isJsSubpage = $this->mTitle->isJsSubpage();
$this->isWrongCaseCssJsPage = $this->isWrongCaseCssJsPage();
+ $this->isNew = !$this->mTitle->exists() || $this->section == 'new';
# Show applicable editing introductions
if ( $this->formtype == 'initial' || $this->firsttime )
@@ -1128,7 +1130,7 @@
$flags = EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
( $new ? EDIT_NEW : EDIT_UPDATE ) |
- ( $this->minoredit ? EDIT_MINOR : 0 ) |
+ ( ( $this->minoredit && !$this->isNew ) ? EDIT_MINOR : 0 ) |
( $bot ? EDIT_FORCE_BOT : 0 );
$status = $this->mArticle->doEdit( $text, $this->summary, $flags );
@@ -1237,7 +1239,7 @@
# Already watched
$this->watchthis = true;
}
- if ( $wgUser->getOption( 'minordefault' ) ) $this->minoredit = true;
+ if ( $wgUser->getOption( 'minordefault' ) && !$this->isNew ) $this->minoredit = true;
if ( $this->textbox1 === false ) return false;
wfProxyCheck();
return true;
@@ -2440,19 +2442,22 @@
$checkboxes = array();
- $checkboxes['minor'] = '';
- $minorLabel = wfMsgExt( 'minoredit', array( 'parseinline' ) );
- if ( $wgUser->isAllowed( 'minoredit' ) ) {
- $attribs = array(
- 'tabindex' => ++$tabindex,
- 'accesskey' => wfMsg( 'accesskey-minoredit' ),
- 'id' => 'wpMinoredit',
- );
- $checkboxes['minor'] =
- Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
- " <label for='wpMinoredit' id='mw-editpage-minoredit'" .
- Xml::expandAttributes( array( 'title' => $skin->titleAttrib( 'minoredit', 'withaccess' ) ) ) .
- ">{$minorLabel}</label>";
+ // don't show the minor edit checkbox if it's a new page or section
+ if ( !$this->isNew ) {
+ $checkboxes['minor'] = '';
+ $minorLabel = wfMsgExt( 'minoredit', array( 'parseinline' ) );
+ if ( $wgUser->isAllowed( 'minoredit' ) ) {
+ $attribs = array(
+ 'tabindex' => ++$tabindex,
+ 'accesskey' => wfMsg( 'accesskey-minoredit' ),
+ 'id' => 'wpMinoredit',
+ );
+ $checkboxes['minor'] =
+ Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
+ " <label for='wpMinoredit' id='mw-editpage-minoredit'" .
+ Xml::expandAttributes( array( 'title' => $skin->titleAttrib( 'minoredit', 'withaccess' ) ) ) .
+ ">{$minorLabel}</label>";
+ }
}
$watchLabel = wfMsgExt( 'watchthis', array( 'parseinline' ) );
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7313
Default Alt Text
27860 (3 KB)
Attached To
Mode
T29860: Do not mark edits as minor by default on new section or new page creation
Attached
Detach File
Event Timeline
Log In to Comment