Expand 5127 to cover editing existing pages, too
authorRob Church <robchurch@users.mediawiki.org>
Mon, 12 Jun 2006 23:06:39 +0000 (23:06 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Mon, 12 Jun 2006 23:06:39 +0000 (23:06 +0000)
RELEASE-NOTES
includes/EditPage.php

index 7e7f81d..e704979 100644 (file)
@@ -383,7 +383,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Add /usr/local/bin to the diff3 search paths in the installer
 * (bug 6106) Update to Indonesian localisation (id) #17
 * (bug 6125) Add links to edit old versions to diff views
-* (bug 5127) Auto edit summary when creating redirect page
+* (bug 5127) Auto edit summary when creating/editing redirect page
 * (bug 3926) Introduce {{#language:}} magic word
 * Fix section links from edit comments for [[:Image:Bla.jpg]] in section titles
 * (bug 6126) Allow fallback to customized primary language when user language
index 9a19225..01efb1b 100644 (file)
@@ -658,6 +658,14 @@ 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 ) {