From 53631ba4e32ed1d30c5f6cd2f588e97f34509bad Mon Sep 17 00:00:00 2001 From: Rob Church Date: Mon, 12 Jun 2006 23:06:39 +0000 Subject: [PATCH] Expand 5127 to cover editing existing pages, too --- RELEASE-NOTES | 2 +- includes/EditPage.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7e7f81d41c..e70497901c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/EditPage.php b/includes/EditPage.php index 9a1922517c..01efb1b8c4 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ) { -- 2.20.1