r59336 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59335‎ | r59336 | r59337 >
Date:15:14, 22 November 2009
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Apply patch from bug 21589 API: Separate summary and initial page text for uploads
Modified paths:
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiUpload.php
@@ -291,9 +291,13 @@
292292 }
293293 }
294294
 295+ // Use comment as initial page text by default
 296+ if (is_null($this->mParams['text']))
 297+ $this->mParams['text'] = $this->mParams['comment'];
 298+
295299 // No errors, no warnings: do the upload
296300 $status = $this->mUpload->performUpload( $this->mParams['comment'],
297 - $this->mParams['comment'], $this->mParams['watch'], $wgUser );
 301+ $this->mParams['text'], $this->mParams['watch'], $wgUser );
298302
299303 if( !$status->isGood() ) {
300304 $error = $status->getErrorsArray();
@@ -329,6 +333,7 @@
330334 'comment' => array(
331335 ApiBase::PARAM_DFLT => ''
332336 ),
 337+ 'text' => null,
333338 'token' => null,
334339 'watch' => false,
335340 'ignorewarnings' => false,
@@ -355,7 +360,8 @@
356361 return array(
357362 'filename' => 'Target filename',
358363 'token' => 'Edit token. You can get one of these through prop=info',
359 - 'comment' => 'Upload comment. Also used as the initial page text for new files',
 364+ 'comment' => 'Upload comment. Also used as the initial page text for new files if "text" is not specified',
 365+ 'text' => 'Initial page text for new files',
360366 'watch' => 'Watch the page',
361367 'ignorewarnings' => 'Ignore any warnings',
362368 'file' => 'File contents',

Follow-up revisions

RevisionCommit summaryAuthorDate
r59346Fix for r59336 Addition of bug to RELEASE-NOTESreedy21:28, 22 November 2009

Comments

#Comment by Mr.Z-man (talk | contribs)   18:28, 22 November 2009

Should probably be noted in RELEASE-NOTES.

#Comment by Reedy (talk | contribs)   21:29, 22 November 2009

Done now

Status & tagging log