Page MenuHomePhabricator

APWLM- REQ2025.03 Prevent uploading the same picture with different names.
Closed, ResolvedPublicFeature

Description

Currently if users tries to upload the same picture with a different name, it succed thsu creating a duplicate in Commons.

Note: instead the standard upload process of Commons has a duplicate check to prevent this to happen

The details of the request are:
• Check the API functionality for upload in order to behave in the same way of standard upload
• If the upload fails for this reason, than the user should get a message with the list of failed uploads

Event Timeline

Ysogo triaged this task as High priority.

Following your self candidature on the item.

We would just need to enable warnings again (which are now disable with ignorewarnings set at 1). Then we would get upload warnings (which we would need to somehow manage) such as:

  • exists: A file with the given name already exists. If this warning is ignored, the uploaded file will replace the existing file.
    • no-change: A file with the given name already exists and is exactly the same as the uploaded file.
    • duplicateversions: A file with the given name already exists and an old version of that file is exactly the same as the uploaded file.
    • was-deleted: a file with the given name used to exist but has been deleted.
    • duplicate: The uploaded file exists under a different (or the same) name. Uploading a duplicate may be undesirable.
    • duplicate-archive: The uploaded used to exist under a different (or the same) name but has been deleted. This may indicate that the file is inappropriate and should not be uploaded.
    • badfilename: The file name supplied is not acceptable on this wiki, for instance because it contains forbidden characters

Otherwise, we could use the ImageHash tool to detect such images before attempting the upload, but I don't think it is worth it.

The feature to prevent uploading the same picture under different names is now implemented. It complements the existing functionality that blocks uploading different pictures under the same name.

Here’s how the updated behavior works:

Feedback on Failure: When an upload fails (i.e. Commons returning a warning), the user is shown a gallery of the failed uploads. For each failed image, the user can choose to either fix the issue or cancel the upload. This decision can be made individually for each image in a batch.

Batch Uploads: In the case of multiple uploads, only the pictures that fail are shown to the user for review.

Multiple Warnings: If a picture fails due to more than one issue, all relevant warnings provided by Commons will be displayed.

Re-submission Behavior: If the user chooses to retry the upload, all duplicate checks and validations will be re-applied. Any new or unresolved issues will be prompted again.