r46417 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46416‎ | r46417 | r46418 >
Date:02:40, 28 January 2009
Author:demon
Status:reverted (Comments)
Tags:
Comment:
Skip dupe warnings when it's a titles are the same and it's a reupload.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -550,7 +550,7 @@
551551 $warning .= self::getExistsWarning( $this->mLocalFile );
552552 }
553553
554 - $warning .= $this->getDupeWarning( $this->mTempPath, $finalExt );
 554+ $warning .= $this->getDupeWarning( $this->mTempPath, $finalExt, $nt );
555555
556556 if( $warning != '' ) {
557557 /**
@@ -757,7 +757,7 @@
758758 * Check for duplicate files and throw up a warning before the upload
759759 * completes.
760760 */
761 - function getDupeWarning( $tempfile, $extension ) {
 761+ function getDupeWarning( $tempfile, $extension, $destinationTitle ) {
762762 $hash = File::sha1Base36( $tempfile );
763763 $dupes = RepoGroup::singleton()->findBySha1( $hash );
764764 $archivedImage = new ArchivedFile( null, 0, $hash.".$extension" );
@@ -766,8 +766,12 @@
767767 $msg = "<gallery>";
768768 foreach( $dupes as $file ) {
769769 $title = $file->getTitle();
770 - $msg .= $title->getPrefixedText() .
771 - "|" . $title->getText() . "\n";
 770+ # Don't throw the warning when the titles are the same, it's a reupload
 771+ # and highly redundant.
 772+ if ( !$title->equals( $destinationTitle ) || !$this->mIsReUpload ) {
 773+ $msg .= $title->getPrefixedText() .
 774+ "|" . $title->getText() . "\n";
 775+ }
772776 }
773777 $msg .= "</gallery>";
774778 return "<li>" .
Index: trunk/phase3/RELEASE-NOTES
@@ -106,6 +106,8 @@
107107 * (bug 15391) catch DBQueryErrors on external storage insertion. This avoids error
108108 messages on save were the edit in fact is saved.
109109 * (bug 17184) Remove duplicate "z" accesskey in MonoBook
 110+* Remove redundant dupe warnings on reupload for the same title. Dupe warnings
 111+ for identical files at different titles are still given.
110112
111113 == API changes in 1.15 ==
112114 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Follow-up revisions

RevisionCommit summaryAuthorDate
r46424Revert r46417 "Skip dupe warnings when it's a titles are the same and it's a ...brion04:28, 28 January 2009
r46444Re-commit r46417 (Skip dupe warnings when it's a titles are the same and it's...demon13:47, 28 January 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   04:27, 28 January 2009

Notice: Undefined property: UploadForm::$mIsReUpload in /Library/WebServer/Documents/trunk/includes/specials/SpecialUpload.php on line 771

#Comment by Brion VIBBER (talk | contribs)   04:28, 28 January 2009

Reverted in r46424

Status & tagging log