GeezerVison is showing static-codereview.wikimedia.org — r104684 MediaWiki - Code Review archive
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)
|
| Index: trunk/phase3/includes/EditPage.php |
| — | — | @@ -867,7 +867,7 @@ |
| 868 | 868 | |
| 869 | 869 | case self::AS_SUCCESS_NEW_ARTICLE: |
| 870 | 870 | $query = $resultDetails['redirect'] ? 'redirect=no' : ''; |
| 871 | | - $wgOut->redirect( $this->mTitle->getFullURL( $query ) ); |
| | 871 | + $wgOut->redirect( $this->mTitle->getFullURL( $query ) . $resultDetails['sectionanchor'] ); |
| 872 | 872 | return false; |
| 873 | 873 | |
| 874 | 874 | case self::AS_SUCCESS_UPDATE: |
| — | — | @@ -1112,8 +1112,17 @@ |
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | 1115 | $text = $this->textbox1; |
| | 1116 | + $result['sectionanchor'] == ''; |
| 1116 | 1117 | if ( $this->section == 'new' && $this->summary != '' ) { |
| 1117 | 1118 | $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 ); |
| 1118 | 1127 | } |
| 1119 | 1128 | |
| 1120 | 1129 | $status->value = self::AS_SUCCESS_NEW_ARTICLE; |
Follow-up revisions
Comments
PHP Notice: Undefined index: sectionanchor in /www/w/includes/EditPage.php on line 870
PHP Notice: Undefined index: sectionanchor in /www/w/includes/EditPage.php on line 1118
Fixed in r106786
Using == instead of =
Status & tagging log
- 12:52, 20 December 2011 Siebrand (talk | contribs) changed the status of r104684 [removed: new added: resolved]
- 12:36, 20 December 2011 Reedy (talk | contribs) changed the status of r104684 [removed: fixme added: new]
- 21:02, 18 December 2011 Raymond (talk | contribs) changed the status of r104684 [removed: resolved added: fixme]
- 14:42, 1 December 2011 😂 (talk | contribs) changed the status of r104684 [removed: new added: resolved]
- 22:48, 30 November 2011 Catrope (talk | contribs) changed the status of r104684 [removed: fixme added: new]
- 21:35, 30 November 2011 Raymond (talk | contribs) changed the status of r104684 [removed: new added: fixme]