Page MenuHomePhabricator

Show not logged in error before uploading to stash in mw.Upload.BookletLayout
Closed, ResolvedPublic1 Estimated Story Points

Description

Even though this happens pretty quickly, the user shouldn't have to select an image and wait for the upload request to find out that they aren not logged in.

Event Timeline

Prtksxna raised the priority of this task from to Medium.
Prtksxna updated the task description. (Show Details)
Prtksxna added a project: Multimedia.

Should use mw.user.getRights and check if the user is allowed to upload.

Here we want to frame it in a positive way ("you need to log-in to upload" ) as opposed to an error ("you forgot to log-in").

I think it makes sense to still keep a "disabled" version of the main entry point that informs about the need to log-in. That should include a clear call to action that allows the user to access the log-in form.

Change 248101 had a related patch set uploaded (by Bartosz Dziewoński):
mediawiki.Upload.BookletLayout: If the user can't upload anything, don't give them the option to

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

The patch above is a very barebones solution. For VE, it will keep the "Upload" tab, but display a short error message instead of the form.

pasted_file (560×514 px, 13 KB)

It doesn't close this task: in addition to this being pretty poor UI, there are at least two problems with it under different MediaWiki configuration (see the commit message). But it'll do the job for now.

Change 248101 merged by jenkins-bot:
mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form

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

Change 248246 had a related patch set uploaded (by Bartosz Dziewoński):
Revert "mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form"

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

Change 248246 merged by jenkins-bot:
Revert "mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form"

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

Would it be possible to show a link to the correct login page?

Probably? We'd have to wait for the ForeignApi to be initialized, then query that to get the scripts paths and stuff for the foreign wiki, then we could make a working link. In Wikimedia config it is sufficient to log in on the local wiki.

Change 257669 had a related patch set uploaded (by Bartosz Dziewoński):
mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form

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

Change 257669 merged by jenkins-bot:
mediawiki.Upload.BookletLayout: If the user can't upload, don't show them the form

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