(bug 29109) Allow the automatic edit summary for redirect creation
authorBrian Wolff <bawolff@users.mediawiki.org>
Mon, 4 Jul 2011 17:03:09 +0000 (17:03 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Mon, 4 Jul 2011 17:03:09 +0000 (17:03 +0000)
show the first bit of the new redirect page.

Adds $2 to the autoredircomment (not used by default) that contains the first 150-ish characters of the newly created redirect page.

Meant so that the Wikipedian's can see their {{R from foo}} templates.

RELEASE-NOTES-1.19
includes/WikiPage.php
languages/messages/MessagesQqq.php

index f518746..e10ffc0 100644 (file)
@@ -62,6 +62,8 @@ production.
   statistics (maintenance/language/transstat.php)
 * (bug 29586) Make the (next 200) links on categories link directly to
   the relevant section of the category.
+* (bug 29109) Allow the automatic edit summary for redirect creation
+  show the first bit of the new redirect page.
 
 === Bug fixes in 1.19 ===
 * (bug 28868) Show total pages in the subtitle of an image on the
index 90cacda..8a823cd 100644 (file)
@@ -2297,7 +2297,10 @@ class WikiPage extends Page {
                $rt = Title::newFromRedirect( $newtext );
 
                if ( is_object( $rt ) && ( !is_object( $ot ) || !$rt->equals( $ot ) || $ot->getFragment() != $rt->getFragment() ) ) {
-                       return wfMsgForContent( 'autoredircomment', $rt->getFullText() );
+                       $truncatedtext = $wgContLang->truncate(
+                               str_replace( "\n", ' ', $newtext ),
+                               max( 0, 200 - strlen( wfMsgForContent( 'autoredircomment' ) ) ) );
+                       return wfMsgForContent( 'autoredircomment', $rt->getFullText(), $truncatedtext );
                }
 
                # New page autosummaries
index 0a3e238..937057a 100644 (file)
@@ -3930,7 +3930,7 @@ Most languages use a space, but some Asian languages, such as Thai and Chinese,
 # Auto-summaries
 'autosumm-blank'   => 'The auto summary when blanking the whole page. This is not the same as deleting the page.',
 'autosumm-replace' => 'The auto summary when a user removes a lot of characters in the page.',
-'autoredircomment' => 'The auto summary when making a redirect. $1 is the page where it redirects to.',
+'autoredircomment' => 'The auto summary when making a redirect. $1 is the page where it redirects to. $2 is the first X number of characters of the redirect ($2 is usually only used when end users customize the message)',
 'autosumm-new'     => 'The auto summary when creating a new page. $1 are the first X number of characters of the new page.',
 
 # Size units