* (bug 7819) Move automatic redirect edit summary after pre-save transform to work properly with subst: fun

Moved the check from EditPage::attemptSave() to Article::doEdit, merging two duplicate code fragments to one.
Should also work with future bot editing interface and other things that don't go through editing UI.
This commit is contained in:
Brion Vibber 2006-11-06 17:59:02 +00:00
parent 95064a38ca
commit 8b3ae11358
3 changed files with 10 additions and 16 deletions

View file

@ -146,6 +146,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
* Allow case-sensitive URLs to be used for uploading from URLs.
* (bug 1109) Correct fix for compressed 304 responses when additional output
buffers have been installed within the compression handler
* (bug 7819) Move automatic redirect edit summary after pre-save transform
to work properly with subst: fun
== Languages updated ==

View file

@ -1272,6 +1272,14 @@ class Article {
$isminor = ( $flags & EDIT_MINOR ) && $wgUser->isAllowed('minoredit');
$bot = $wgUser->isAllowed( 'bot' ) || ( $flags & EDIT_FORCE_BOT );
# If no edit comment was given when creating a new page, and what's being
# created is a redirect, be smart and fill in a neat auto-comment
if( $summary == '' ) {
$rt = Title::newFromRedirect( $text );
if( is_object( $rt ) )
$summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() );
}
$text = $this->preSaveTransform( $text );
$dbw =& wfGetDB( DB_MASTER );

View file

@ -652,14 +652,6 @@ class EditPage {
return false;
}
# If no edit comment was given when creating a new page, and what's being
# created is a redirect, be smart and fill in a neat auto-comment
if( $this->summary == '' ) {
$rt = Title::newFromRedirect( $this->textbox1 );
if( is_object( $rt ) )
$this->summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() );
}
$isComment=($this->section=='new');
$this->mArticle->insertNewArticle( $this->textbox1, $this->summary,
$this->minoredit, $this->watchthis, false, $isComment);
@ -731,14 +723,6 @@ class EditPage {
return true;
}
# If no edit comment was given when turning a page into a redirect, be smart
# and fill in a neat auto-comment
if( $this->summary == '' ) {
$rt = Title::newFromRedirect( $this->textbox1 );
if( is_object( $rt ) )
$this->summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() );
}
# Handle the user preference to force summaries here
if( $this->section != 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary' ) ) {
if( md5( $this->summary ) == $this->autoSumm ) {