Index: trunk/phase3/includes/Defines.php |
— | — | @@ -193,6 +193,7 @@ |
194 | 194 | define( 'EDIT_SUPPRESS_RC', 8 ); |
195 | 195 | define( 'EDIT_FORCE_BOT', 16 ); |
196 | 196 | define( 'EDIT_DEFER_UPDATES', 32 ); |
| 197 | +define( 'EDIT_AUTOSUMMARY', 64 ); |
197 | 198 | /**#@-*/ |
198 | 199 | |
199 | 200 | /** |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1154,7 +1154,7 @@ |
1155 | 1155 | * @deprecated use Article::doEdit() |
1156 | 1156 | */ |
1157 | 1157 | function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) { |
1158 | | - $flags = EDIT_NEW | EDIT_DEFER_UPDATES | |
| 1158 | + $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | |
1159 | 1159 | ( $isminor ? EDIT_MINOR : 0 ) | |
1160 | 1160 | ( $suppressRC ? EDIT_SUPPRESS_RC : 0 ); |
1161 | 1161 | |
— | — | @@ -1186,7 +1186,7 @@ |
1187 | 1187 | * @deprecated use Article::doEdit() |
1188 | 1188 | */ |
1189 | 1189 | function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) { |
1190 | | - $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | |
| 1190 | + $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | |
1191 | 1191 | ( $minor ? EDIT_MINOR : 0 ) | |
1192 | 1192 | ( $forceBot ? EDIT_FORCE_BOT : 0 ); |
1193 | 1193 | |
— | — | @@ -1235,6 +1235,8 @@ |
1236 | 1236 | * Mark the edit a "bot" edit regardless of user rights |
1237 | 1237 | * EDIT_DEFER_UPDATES |
1238 | 1238 | * Defer some of the updates until the end of index.php |
| 1239 | + * EDIT_AUTOSUMMARY |
| 1240 | + * Fill in blank summaries with generated text where possible |
1239 | 1241 | * |
1240 | 1242 | * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected. |
1241 | 1243 | * If EDIT_UPDATE is specified and the article doesn't exist, the function will return false. If |
— | — | @@ -1274,7 +1276,7 @@ |
1275 | 1277 | |
1276 | 1278 | # If no edit comment was given when creating a new page, and what's being |
1277 | 1279 | # created is a redirect, be smart and fill in a neat auto-comment |
1278 | | - if( $summary == '' ) { |
| 1280 | + if ( $flags & EDIT_AUTOSUMMARY && $summary == '' ) { |
1279 | 1281 | $rt = Title::newFromRedirect( $text ); |
1280 | 1282 | if( is_object( $rt ) ) |
1281 | 1283 | $summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() ); |