(bug 5127) Auto edit summary when creating redirect page
authorRob Church <robchurch@users.mediawiki.org>
Wed, 31 May 2006 00:57:06 +0000 (00:57 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 31 May 2006 00:57:06 +0000 (00:57 +0000)
RELEASE-NOTES
includes/EditPage.php
languages/Messages.php

index 382c324..f866a00 100644 (file)
@@ -385,6 +385,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
 
 == Compatibility ==
 
index 97342d5..341427b 100644 (file)
@@ -576,6 +576,14 @@ 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);
index 733f715..7b8467c 100644 (file)
@@ -206,6 +206,7 @@ parent class in order maintain consistency across languages.
 'viewtalkpage' => 'View discussion',
 'otherlanguages' => 'In other languages',
 'redirectedfrom' => '(Redirected from $1)',
+'autoredircomment' => 'Redirecting to [[$1]]',
 'redirectpagesub' => 'Redirect page',
 'lastmodified' => 'This page was last modified $1.',
 'viewcount'            => 'This page has been accessed {{plural:$1|one time|$1 times}}.',