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.
|Declined||dchen||T118706 Conduct heuristic evaluation of image upload and insert flow in VisualEditor|
|Open||None||T115858 Design improvements for mw.ForeignStructuredUpload.BookletLayout|
|Resolved||matmarex||T119314 MWMediaDialog: exception "Local uploads are disabled"|
|Resolved||matmarex||T115866 Show not logged in error before uploading to stash in mw.Upload.BookletLayout|
|Resolved||matmarex||T117868 Factor out mw.user.getRights()/getGroups() into a mediawiki.api module (so that it can be used with ForeignApi)|
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.
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.
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.
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.