From: Tim Laqua Date: Sun, 2 Sep 2007 01:41:56 +0000 (+0000) Subject: Fixed bug 10836 X-Git-Tag: 1.31.0-rc.0~51561 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=9d01b3e15648dda0f95f6195d0985fddedac07d2;p=lhc%2Fweb%2Fwiklou.git Fixed bug 10836 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 --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 533011a5e0..1be8306ea1 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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) and 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 == diff --git a/includes/Article.php b/includes/Article.php index e0112aa3e0..9d2909fe11 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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 ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 6a70a4155e..3fef550e11 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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',