Page MenuHomePhabricator

Trying to upload image under blacklisted title in the upload image dialog throws error "<api-error-titleblacklist-custom-imagename>"
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproducible:

  1. Go to Media Settings>Upload

2.Select and image
3.No w from the Details dialog change the name of the image to make it customized
4.Click on "Save" on the dialog

Observed Result:
A not so understandable error "<api-error-titleblacklist-custom-imagename>" shows up on the dialog

Screen Shot 2015-10-07 at 12.53.21 PM.png (573×535 px, 41 KB)

Event Timeline

Ryasmeen raised the priority of this task from to Needs Triage.
Ryasmeen updated the task description. (Show Details)
Ryasmeen added a project: VisualEditor.
Ryasmeen subscribed.

Change 244429 had a related patch set uploaded (by Prtksxna):
i18n: Add message api-error-titleblacklist-custom-imagename

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

Change 244429 abandoned by Bartosz Dziewoński:
i18n: Add message api-error-titleblacklist-custom-imagename

Reason:
Different approach needed.

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

Change 244512 had a related patch set uploaded (by Bartosz Dziewoński):
mw.Upload: Refactor error handling for the umpteenth time

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

matmarex renamed this task from Trying to change the name of the image in the upload image dialog throws error "<api-error-titleblacklist-custom-imagename>" to Trying to upload image under blacklisted title in the upload image dialog throws error "<api-error-titleblacklist-custom-imagename>".Oct 8 2015, 8:57 PM

The patch above does not fix the issue yet (we're still not handling TitleBlacklist errors), but it lays some groundwork and makes the error message return all available information (such as Unknown error: "{"servedby":"deployment-mediawiki01","error":{"code":"senselessimagename","info":"TitleBlacklist prevents this title from being created","filekey":"13i5i0u8vv8w.5sc2g2.1252.jpg","sessionkey":"13i5i0u8vv8w.5sc2g2.1252.jpg","invalidparameter":"filename","*":"See http://commons.wikimedia.beta.wmflabs.org/w/api.php for API usage"}}".), which does at least mention that "TitleBlacklist prevents this title from being created".

Change 244676 had a related patch set uploaded (by Bartosz Dziewoński):
mediawiki.Upload.BookletLayout: Handle errors from TitleBlacklist (HACK)

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

It seems to be that devising and introducing a sane, non-hacky method to handle TitleBlacklist-blocked file names is something we should've planned at least several weeks in advance :/

Change 244512 merged by jenkins-bot:
mw.Upload: Refactor error handling for the umpteenth time

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

Change 244676 merged by jenkins-bot:
mediawiki.Upload.BookletLayout: Handle errors from TitleBlacklist (HACK)

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

You get this now (you can't verify on Beta because of T115302):

pasted_file (559×512 px, 24 KB)

…just barely better. See T115260 about actually providing useful information.