From: Rob Church Date: Wed, 31 May 2006 00:57:06 +0000 (+0000) Subject: (bug 5127) Auto edit summary when creating redirect page X-Git-Tag: 1.31.0-rc.0~56959 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=2a4391d98ead36d4bed48289a2c3d931476be612;p=lhc%2Fweb%2Fwiklou.git (bug 5127) Auto edit summary when creating redirect page --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 382c324ffa..f866a00ed2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/EditPage.php b/includes/EditPage.php index 97342d559d..341427b63a 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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); diff --git a/languages/Messages.php b/languages/Messages.php index 733f715e5a..7b8467c6b1 100644 --- a/languages/Messages.php +++ b/languages/Messages.php @@ -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}}.',