Page MenuHomePhabricator

API error message for upload-protected file appears twice
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Edit any page in Visual editor, for example this page
  • Make random screenshot. Tested with Ubuntu 26.04, FireFox 151.0.2 (64-bit)
  • In any place on the page push Ctrl+V. You will get long text with error and then again the same text. This is bug, should be the only one text without duplication. And also If you think that wiki should allow uploading an images from clipboard (best for users) then such error should not happen. But if you don't plan to make such feature then fix error text to add "images from clipboard can't be inserted".

What happens?:
Error text "This page is currently semi-protected, and can be edited only by established registered users.

Semi-protection is sometimes necessary to prevent vandalism to popular pages. Most media files and gallery pages can be edited by anyone.
The reason for protection can be found in the protection log.
If you have a user account, log in first. If you do not yet have an account, you may create one; after a while, you will be able to edit semi-protected pages.
You may request unprotection of the page."

add screenshot fails with wrong error.png (1,867×1,185 px, 367 KB)

What should have happened instead?:
The Image should be inserted from a clipboard

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Ubuntu 26.04, FireFox 151.0.2 (64-bit)

Event Timeline

DungeonLords renamed this task from add screenshot fails with wrong error to add screenshot from clipboard fails with wrong error.Jun 4 2026, 7:14 AM

You're getting this error message because you're trying to upload a file with the name "Image.png" (that's the default for copy-pasted images), and that file name has been protected, so that people use more descriptive names (see https://commons.wikimedia.org/wiki/File:Image.png). You can edit the name in the upload dialog, after which the upload should succeed.

The message should not appear twice though, for sure. And it could be more useful; the current text is shared with the error for editing protected pages (see T23645).

matmarex renamed this task from add screenshot from clipboard fails with wrong error to API error message for upload-protected file appears twice.Jun 8 2026, 10:13 AM
matmarex edited projects, added: MediaWiki-Uploading; removed: VisualEditor.

Change #1298727 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/core@master] UploadBase: Avoid duplicate error messages for upload-protected files

https://gerrit.wikimedia.org/r/1298727

Change #1298727 merged by jenkins-bot:

[mediawiki/core@master] UploadBase: Avoid duplicate error messages for upload-protected files

https://gerrit.wikimedia.org/r/1298727

matmarex claimed this task.

The change will be deployed to Wikimedia wikis this week, on the usual schedule, reaching Wikipedias on Thursday. https://wikitech.wikimedia.org/wiki/Deployments/Train#Schedule