From: Sam Reed Date: Sun, 22 Nov 2009 15:14:19 +0000 (+0000) Subject: Apply patch from bug 21589 API: Separate summary and initial page text for uploads X-Git-Tag: 1.31.0-rc.0~38733 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=9546d0bffcf9f35aad25c89cb5d2211f162db61b;p=lhc%2Fweb%2Fwiklou.git Apply patch from bug 21589 API: Separate summary and initial page text for uploads --- diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index faa948a3f9..f8854eebcc 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -291,9 +291,13 @@ class ApiUpload extends ApiBase { } } + // Use comment as initial page text by default + if (is_null($this->mParams['text'])) + $this->mParams['text'] = $this->mParams['comment']; + // No errors, no warnings: do the upload $status = $this->mUpload->performUpload( $this->mParams['comment'], - $this->mParams['comment'], $this->mParams['watch'], $wgUser ); + $this->mParams['text'], $this->mParams['watch'], $wgUser ); if( !$status->isGood() ) { $error = $status->getErrorsArray(); @@ -329,6 +333,7 @@ class ApiUpload extends ApiBase { 'comment' => array( ApiBase::PARAM_DFLT => '' ), + 'text' => null, 'token' => null, 'watch' => false, 'ignorewarnings' => false, @@ -355,7 +360,8 @@ class ApiUpload extends ApiBase { return array( 'filename' => 'Target filename', 'token' => 'Edit token. You can get one of these through prop=info', - 'comment' => 'Upload comment. Also used as the initial page text for new files', + 'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified', + 'text' => 'Initial page text for new files', 'watch' => 'Watch the page', 'ignorewarnings' => 'Ignore any warnings', 'file' => 'File contents',