http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65025
Revision: 65025 Author: btongminh Date: 2010-04-14 13:53:20 +0000 (Wed, 14 Apr 2010) Log Message: ----------- (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: trunk/phase3/includes/specials/SpecialUpload.php =================================================================== --- trunk/phase3/includes/specials/SpecialUpload.php 2010-04-14 13:22:24 UTC (rev 65024) +++ trunk/phase3/includes/specials/SpecialUpload.php 2010-04-14 13:53:20 UTC (rev 65025) @@ -313,11 +313,13 @@ * warnings and the should continue processing like there was no warning */ protected function showUploadWarning( $warnings ) { - # If there are no warnings, or warnings we can ignore, return early - if ( - !$warnings || ( count( $warnings ) == 1 && - isset( $warnings['exists']) && $this->mDestWarningAck ) - ) + # If there are no warnings, or warnings we can ignore, return early. + # mDestWarningAck is set when some javascript has shown the warning + # to the user. mForReUpload is set when the user clicks the "upload a + # new version" link. + if ( !$warnings || ( count( $warnings ) == 1 && + isset( $warnings['exists'] ) && + ( $this->mDestWarningAck || $this->mForReUpload ) ) ) { return false; } @@ -936,7 +938,7 @@ protected function getOptionsSection() { global $wgUser; - if( $wgUser->isLoggedIn() ) { + if ( $wgUser->isLoggedIn() ) { $descriptor = array( 'Watchthis' => array( 'type' => 'check', @@ -947,7 +949,7 @@ ) ); } - if( !$this->mHideIgnoreWarning ) { + if ( !$this->mHideIgnoreWarning ) { $descriptor['IgnoreWarning'] = array( 'type' => 'check', 'id' => 'wpIgnoreWarning', @@ -956,11 +958,19 @@ ); } - $descriptor['wpDestFileWarningAck'] = array( + $descriptor['DestFileWarningAck'] = array( 'type' => 'hidden', 'id' => 'wpDestFileWarningAck', 'default' => $this->mDestWarningAck ? '1' : '', ); + + if ( $this->mForReUpload ) { + $descriptor['ForReUpload'] = array( + 'type' => 'hidden', + 'id' => 'wpForReUpload', + 'default' => '1', + ); + } return $descriptor; } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs