Fixed bug 10836
authorTim Laqua <tlaqua@users.mediawiki.org>
Sun, 2 Sep 2007 01:41:56 +0000 (01:41 +0000)
committerTim Laqua <tlaqua@users.mediawiki.org>
Sun, 2 Sep 2007 01:41:56 +0000 (01:41 +0000)
When a new section is appended to an article, the comment is wrapped with /* ... */ tags to ensure that Recent Changes listings will have a link to the newly created heading.
Changed system message editsummaryheading to newsectionheaderdefaultlevel on rec. from DannyB

RELEASE-NOTES
includes/Article.php
languages/messages/MessagesEn.php

index 533011a..1be8306 100644 (file)
@@ -194,8 +194,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   text for a non-existent page
 * (bug 11022) Use a more accurate page title for Special:Whatlinkshere and
   Special:Recentchangeslinked
-* Add 'editsummaryheading' message to allow modification of the heading
-  formatting for new sections (when section=new argument is supplied)
+* Add 'newsectionheaderdefaultlevel' message to allow modification of the 
+  heading formatting for new sections when section=new argument is supplied
   
 == Bugfixes since 1.10 ==
 
@@ -429,7 +429,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 8393) <sup> and <sub> need to be preserved (without attributes) for
   entries in the table of contents
 * (bug 11114) Fix regression in read-only mode error display during editing
-* (bug 9426) Some way to specify heading level for new sections
+* (bug 10836) Change the summary on creating of new section
 
 == API changes since 1.10 ==
 
index e0112aa..9d2909f 100644 (file)
@@ -1160,7 +1160,7 @@ class Article {
        /**
         * @return string Complete article text, or null if error
         */
-       function replaceSection($section, $text, $summary = '', $edittime = NULL) {
+       function replaceSection($section, $text, &$summary = '', $edittime = NULL) {
                wfProfileIn( __METHOD__ );
 
                if( $section == '' ) {
@@ -1181,7 +1181,9 @@ class Article {
 
                        if( $section == 'new' ) {
                                # Inserting a new section
-                               $subject = $summary ? wfMsgForContent('editsummaryheading',$summary) . "\n\n" : '';
+                               $subject = $summary ? wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n" : '';
+                               # Heading has been added to text, now wrap comment for RC linking to heading
+                               $summary = "/* {$summary} */";
                                $text = strlen( trim( $oldtext ) ) > 0
                                                ? "{$oldtext}\n\n{$subject}{$text}"
                                                : "{$subject}{$text}";
@@ -1200,14 +1202,16 @@ class Article {
        /**
         * @deprecated use Article::doEdit()
         */
-       function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
+       function insertNewArticle( $text, &$summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
                $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
                        ( $isminor ? EDIT_MINOR : 0 ) |
                        ( $suppressRC ? EDIT_SUPPRESS_RC : 0 );
 
                # If this is a comment, add the summary as headline
                if ( $comment && $summary != "" ) {
-                       $text = wfMsgForContent('editsummaryheading',$summary) . "\n\n" . $text;
+                       $text = wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n".$text;
+                       # Heading has been added to text, now wrap comment for RC linking to heading
+                       $summary = "/* {$summary} */";
                }
 
                $this->doEdit( $text, $summary, $flags );
index 6a70a41..3fef550 100644 (file)
@@ -709,7 +709,7 @@ XHTML id names.
 'feed-rss'                => 'RSS', # only translate this message to other languages if you have to change it
 'sitenotice'              => '-', # the equivalent to wgSiteNotice; don't translate or duplicate this message to other languages
 'anonnotice'              => '-', # don't translate or duplicate this message to other languages
-'editsummaryheading'      => '== $1 ==', # don't translate or duplicate this message to other languages
+'newsectionheaderdefaultlevel' => '== $1 ==', # don't translate or duplicate this message to other languages
 
 # Short words for each namespace, by default used in the 'article' tab in monobook
 'nstab-main'      => 'Article',