Page MenuHomePhabricator

Upload wizard blocks file names with # but shows no error in UI; "extension is null" shown in error console
Closed, ResolvedPublic

Description

Upload an image using the Wizard, in the Describe screen enter a valid Image title and Description.
Now add a # character in the Image title.
Click on the Publish Files button: nothing happens.

The publishing is blocked because of the forbidden # in the Image title.
The user isn't informed of the issue.

An error message shall say: 'This title is invalid. Make sure to remove characters like square brackets, colons, slashes, comparison operators, pipes, curly brackets AND HASH SIGNS.' (capitals for the added part)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 14 2019, 7:26 PM
Aklapper renamed this task from Commons Upload wizard blocks file names with # but shows no error message to Upload wizard blocks file names with # but shows no error in UI; "extension is null" shown in error console.Nov 19 2019, 1:36 PM

Hi @Romainbehar, thanks for taking the time to report this and welcome to Wikimedia Phabricator!

Confirming.

Trying on https://test.wikipedia.org/wiki/Special:UploadWizard?debug=true and in the 4th tab ("Describe") changing the "Image title" field from 3sterne to 3#sterne, filing in a date and a description, and clicking "Publish files", I see this in the error console:

jQuery.Deferred exception: extension is null Title.js/Title.normalizeExtension@https://test.wikipedia.org/w/load.php?debug=true&lang=en&modules=ext.centralNotice.geoIP%7Cext.centralauth.ForeignApi%7Cext.centralauth.centralautologin.clearcookie%7Cext.cx.eventlogging.campaigns%7Cext.dismissableSiteNotice%2CeventLogging%2CnavigationTiming%2Cpopups%2CwikimediaEvents%7Cext.echo.api%2Cinit%7Cext.uls.common%2Ccompactlinks%2Cinit%2Cinterface%2Cpreferences%2Cwebfonts%7Cext.wikimediaEvents.loggedin%7Cjquery%2Cmoment%2Coojs%2Coojs-ui-core%2Coojs-ui-widgets%2Coojs-ui-windows%2Csite%7Cjquery.client%2Ccookie%2CgetAttrs%2ChighlightText%2ClengthLimit%2CmakeCollapsible%2Cspinner%2Csuggestions%2CtextSelection%7Cjquery.makeCollapsible.styles%7Cjquery.uls.data%7Cmediawiki.ForeignApi%2CString%2CTitle%2CUri%2Capi%2Cbase%2Ccldr%2CconfirmCloseWindow%2Ccookie%2Cexperiments%2Cfeedback%2Chtmlform%2Cicon%2CjqueryMsg%2Clanguage%2CmessagePoster%2Cnotify%2CsearchSuggest%2Cstorage%2Ctemplate%2Cuser%2Cutil%2Cwidgets%7Cmediawiki.ForeignApi.core%7Cmediawiki.editfont.styles%7Cmediawiki.libs.jpegmeta%2Cpluralruleparser%7Cmediawiki.page.ready%2Cstartup%7Cmediawiki.template.regexp%7Cmediawiki.ui.button%7Cmediawiki.widgets.CategoryMultiselectWidget%2CDateInputWidget%2Cstyles%7Cmediawiki.widgets.DateInputWidget.styles%7Coojs-ui-core.icons%2Cstyles%7Coojs-ui-widgets.icons%7Coojs-ui-windows.icons%7Coojs-ui.styles.icons-content%2Cicons-editing-advanced%2Cicons-editing-core%2Cicons-interactions%2Cicons-location%2Cicons-moderation%2Cicons-movement%2Cindicators%7Cskins.vector.js%7Cuser.defaults&skin=vector&version=1aepl:2954:11
uw.controller.Details.prototype.valid/</promise<@https://test.wikipedia.org/w/extensions/UploadWizard/resources/controller/uw.controller.Details.js?5c8a3:193:47
mightThrow@https://test.wikipedia.org/w/resources/lib/jquery/jquery.js?6fb03:3535:29
resolve/</process<@https://test.wikipedia.org/w/resources/lib/jquery/jquery.js?6fb03:3603:12
 undefined

Confirming as well. Myself and several other editors spent quite some time trying to assist a user with this issue, but had difficulty figuring out what the problem was because of the lack of error message.

Change 631955 had a related patch set uploaded (by AntiCompositeNumber; owner: AntiCompositeNumber):
[mediawiki/extensions/UploadWizard@master] uw.TitleDetailsWidget.js: Throw error-title-invalid for titles including octothorpe

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

Change 631955 merged by jenkins-bot:
[mediawiki/extensions/UploadWizard@master] uw.TitleDetailsWidget.js: Throw error-title-invalid for titles including octothorpe

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

AntiCompositeNumber closed this task as Resolved.Oct 19 2020, 4:15 PM
AntiCompositeNumber triaged this task as Medium priority.

Tested on beta commons, patch works as intended. Should be deployed to Commons via the train on Wednesday.