r65025 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65024‎ | r65025 | r65026 >
Date:13:53, 14 April 2010
Author:btongminh
Status:ok
Tags:
Comment:
(bug 23176) Fixed regression: "upload new version" link should not trigger a file-exists warning

Also fixed a mislabeled form field.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -313,11 +313,13 @@
314314 * warnings and the should continue processing like there was no warning
315315 */
316316 protected function showUploadWarning( $warnings ) {
317 - # If there are no warnings, or warnings we can ignore, return early
318 - if (
319 - !$warnings || ( count( $warnings ) == 1 &&
320 - isset( $warnings['exists']) && $this->mDestWarningAck )
321 - )
 317+ # If there are no warnings, or warnings we can ignore, return early.
 318+ # mDestWarningAck is set when some javascript has shown the warning
 319+ # to the user. mForReUpload is set when the user clicks the "upload a
 320+ # new version" link.
 321+ if ( !$warnings || ( count( $warnings ) == 1 &&
 322+ isset( $warnings['exists'] ) &&
 323+ ( $this->mDestWarningAck || $this->mForReUpload ) ) )
322324 {
323325 return false;
324326 }
@@ -936,7 +938,7 @@
937939 protected function getOptionsSection() {
938940 global $wgUser;
939941
940 - if( $wgUser->isLoggedIn() ) {
 942+ if ( $wgUser->isLoggedIn() ) {
941943 $descriptor = array(
942944 'Watchthis' => array(
943945 'type' => 'check',
@@ -947,7 +949,7 @@
948950 )
949951 );
950952 }
951 - if( !$this->mHideIgnoreWarning ) {
 953+ if ( !$this->mHideIgnoreWarning ) {
952954 $descriptor['IgnoreWarning'] = array(
953955 'type' => 'check',
954956 'id' => 'wpIgnoreWarning',
@@ -956,11 +958,19 @@
957959 );
958960 }
959961
960 - $descriptor['wpDestFileWarningAck'] = array(
 962+ $descriptor['DestFileWarningAck'] = array(
961963 'type' => 'hidden',
962964 'id' => 'wpDestFileWarningAck',
963965 'default' => $this->mDestWarningAck ? '1' : '',
964966 );
 967+
 968+ if ( $this->mForReUpload ) {
 969+ $descriptor['ForReUpload'] = array(
 970+ 'type' => 'hidden',
 971+ 'id' => 'wpForReUpload',
 972+ 'default' => '1',
 973+ );
 974+ }
965975
966976 return $descriptor;
967977 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r650261.16wmf4: MFT r65025catrope13:59, 14 April 2010
r66941MFT r65025, bug 23176: fixed broken "upload new version" link. Skipped the wh...tstarling06:21, 27 May 2010

Status & tagging log