Index: branches/wmf/1.17wmf1/extensions/WikiLove/WikiLove.api.php |
— | — | @@ -19,13 +19,13 @@ |
20 | 20 | $this->saveInDb( $talk, $params['subject'], $params['message'], $params['type'], isset( $params['email'] ) ? 1 : 0 ); |
21 | 21 | } |
22 | 22 | |
23 | | - $article = new Article( $talk, 0 ); |
24 | | - |
25 | 23 | // not using section => 'new' here, as we like to give our own edit summary |
26 | 24 | $api = new ApiMain( new FauxRequest( array( |
27 | 25 | 'action' => 'edit', |
28 | 26 | 'title' => $talk->getFullText(), |
29 | | - 'text' => $article->replaceSection( 'new', $params['text'], $params['subject'] ), |
| 27 | + // need to do this, as Article::replaceSection fails for non-existing pages |
| 28 | + 'appendtext' => ( $talk->exists() ? "\n\n" : '' ) . wfMsgForContent( 'newsectionheaderdefaultlevel', $params['subject'] ) |
| 29 | + . "\n\n" . $params['text'], |
30 | 30 | 'token' => $params['token'], |
31 | 31 | 'summary' => wfMsgForContent( 'wikilove-summary', $wgParser->stripSectionName( $params['subject'] ) ), |
32 | 32 | 'notminor' => true, |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiLove |
___________________________________________________________________ |
Modified: svn:mergeinfo |
33 | 33 | Merged /trunk/extensions/WikiLove:r90136 |