r25398 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25397‎ | r25398 | r25399 >
Date:01:41, 2 September 2007
Author:tlaqua
Status:old
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1160,7 +1160,7 @@
11611161 /**
11621162 * @return string Complete article text, or null if error
11631163 */
1164 - function replaceSection($section, $text, $summary = '', $edittime = NULL) {
 1164+ function replaceSection($section, $text, &$summary = '', $edittime = NULL) {
11651165 wfProfileIn( __METHOD__ );
11661166
11671167 if( $section == '' ) {
@@ -1181,7 +1181,9 @@
11821182
11831183 if( $section == 'new' ) {
11841184 # Inserting a new section
1185 - $subject = $summary ? wfMsgForContent('editsummaryheading',$summary) . "\n\n" : '';
 1185+ $subject = $summary ? wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n" : '';
 1186+ # Heading has been added to text, now wrap comment for RC linking to heading
 1187+ $summary = "/* {$summary} */";
11861188 $text = strlen( trim( $oldtext ) ) > 0
11871189 ? "{$oldtext}\n\n{$subject}{$text}"
11881190 : "{$subject}{$text}";
@@ -1200,14 +1202,16 @@
12011203 /**
12021204 * @deprecated use Article::doEdit()
12031205 */
1204 - function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
 1206+ function insertNewArticle( $text, &$summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
12051207 $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
12061208 ( $isminor ? EDIT_MINOR : 0 ) |
12071209 ( $suppressRC ? EDIT_SUPPRESS_RC : 0 );
12081210
12091211 # If this is a comment, add the summary as headline
12101212 if ( $comment && $summary != "" ) {
1211 - $text = wfMsgForContent('editsummaryheading',$summary) . "\n\n" . $text;
 1213+ $text = wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n".$text;
 1214+ # Heading has been added to text, now wrap comment for RC linking to heading
 1215+ $summary = "/* {$summary} */";
12121216 }
12131217
12141218 $this->doEdit( $text, $summary, $flags );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -709,7 +709,7 @@
710710 'feed-rss' => 'RSS', # only translate this message to other languages if you have to change it
711711 'sitenotice' => '-', # the equivalent to wgSiteNotice; don't translate or duplicate this message to other languages
712712 'anonnotice' => '-', # don't translate or duplicate this message to other languages
713 -'editsummaryheading' => '== $1 ==', # don't translate or duplicate this message to other languages
 713+'newsectionheaderdefaultlevel' => '== $1 ==', # don't translate or duplicate this message to other languages
714714
715715 # Short words for each namespace, by default used in the 'article' tab in monobook
716716 'nstab-main' => 'Article',
Index: trunk/phase3/RELEASE-NOTES
@@ -194,8 +194,8 @@
195195 text for a non-existent page
196196 * (bug 11022) Use a more accurate page title for Special:Whatlinkshere and
197197 Special:Recentchangeslinked
198 -* Add 'editsummaryheading' message to allow modification of the heading
199 - formatting for new sections (when section=new argument is supplied)
 198+* Add 'newsectionheaderdefaultlevel' message to allow modification of the
 199+ heading formatting for new sections when section=new argument is supplied
200200
201201 == Bugfixes since 1.10 ==
202202
@@ -429,7 +429,7 @@
430430 * (bug 8393) <sup> and <sub> need to be preserved (without attributes) for
431431 entries in the table of contents
432432 * (bug 11114) Fix regression in read-only mode error display during editing
433 -* (bug 9426) Some way to specify heading level for new sections
 433+* (bug 10836) Change the summary on creating of new section
434434
435435 == API changes since 1.10 ==
436436

Follow-up revisions

RevisionCommit summaryAuthorDate
r25400Backing off fix for bug 10836 - previous attempt was incomplete. Will revisi...tlaqua02:50, 2 September 2007
r25415Merged revisions 25372-25414 via svnmerge from...david21:15, 2 September 2007
r25445Fixed bug 10836...tlaqua17:46, 3 September 2007
r25454Merged revisions 25415-25453 via svnmerge from...david19:27, 3 September 2007
r25573Refining fix for bug 10836 - taking care of unintended behavior....tlaqua04:11, 6 September 2007
r25607Merged revisions 25530-25606 via svnmerge from...david06:11, 7 September 2007

Status & tagging log