r104684 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104683‎ | r104684 | r104685 >
Date:14:51, 30 November 2011
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
)bug 15521) Use new section summary when the action of adding a new section also happens to create the page. Patch by Harry Burt
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -867,7 +867,7 @@
868868
869869 case self::AS_SUCCESS_NEW_ARTICLE:
870870 $query = $resultDetails['redirect'] ? 'redirect=no' : '';
871 - $wgOut->redirect( $this->mTitle->getFullURL( $query ) );
 871+ $wgOut->redirect( $this->mTitle->getFullURL( $query ) . $resultDetails['sectionanchor'] );
872872 return false;
873873
874874 case self::AS_SUCCESS_UPDATE:
@@ -1112,8 +1112,17 @@
11131113 }
11141114
11151115 $text = $this->textbox1;
 1116+ $result['sectionanchor'] == '';
11161117 if ( $this->section == 'new' && $this->summary != '' ) {
11171118 $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $text;
 1119+
 1120+ # Jump to the new section
 1121+ $result['sectionanchor'] = $wgParser->guessLegacySectionNameFromWikiText( $this->summary );
 1122+
 1123+ # This is a new section, so create a link to the new section
 1124+ # in the revision summary.
 1125+ $cleanSummary = $wgParser->stripSectionName( $this->summary );
 1126+ $this->summary = wfMsgForContent( 'newsectionsummary', $cleanSummary );
11181127 }
11191128
11201129 $status->value = self::AS_SUCCESS_NEW_ARTICLE;

Follow-up revisions

RevisionCommit summaryAuthorDate
r104686RELEASE-NOTES for r104668, r104671, r104684catrope14:56, 30 November 2011
r104767Fix notice in r104684catrope22:48, 30 November 2011
r106786Fix for r104684...reedy12:36, 20 December 2011

Comments

#Comment by Raymond (talk | contribs)   21:35, 30 November 2011
PHP Notice: Undefined index: sectionanchor in /www/w/includes/EditPage.php on line 870
#Comment by Raymond (talk | contribs)   21:02, 18 December 2011
 PHP Notice: Undefined index: sectionanchor in /www/w/includes/EditPage.php on line 1118
#Comment by Reedy (talk | contribs)   12:36, 20 December 2011

Fixed in r106786

Using == instead of =

Status & tagging log