When JavaScript is disabled on /admin/content/media, users are unable to use the '+ Add file' button.
On the non-JS version, the '+ Media browser' button is shown instead. However when clicking on it, the interface on /admin/content/media/browser#media-tab-library doesn't seem to work properly. There are 2 links on this page, Upload and Library, and neither seems to do anything. And after uploading an image on this page, one is redirected to a totally blank page (without header, footer, menu, or other site furnitures) showing just the Drupal message 'Status message The file [filename] was uploaded'.
What should happen: non-JS version should show the '+ Add file' button like with the JS one. And when clicked, it should go to a page for uploading file (don't need Library link), like in the iframe overlay on the JS-enabled version. When form is submitted, it should redirect to the /media/[id] page with the appropriate Drupal confirmation message.
Not being fussy here, but core functionality like this should not be reliant on JavaScript. Also fixing this will enable more flexibility for people to link directly to the 'Add File' page on a menu etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | media-hide-addfile-nonjs-followup-1238298-8.patch | 2.77 KB | effulgentsia |
| #5 | hide-addfile-nonjs-1238298.patch | 2.07 KB | robeano |
Comments
Comment #1
dave reidI don't think the Media browser works at all without JavaScript. I really wish we had a .js-show class provided in core. We may need to apply it to this link and elsewhere.
Comment #2
idflood commentedlooks like a duplicate of #1023156: Allow users without JavaScript to add media to a site
Comment #3
robeano commentedI'm taking this one. For now, Media requires Javascript.
Comment #4
robeano commentedPatched to hide the Add file link in admin/content/media.
I also added that JS is required in the help text.
Updates should be made to any documentation. The module's project page has been updated.
Comment #5
robeano commentedPatched to hide the Add file link in admin/content/media.
I also added that JS is required in the help text.
Updates should be made to any documentation. The module's project page has been updated.
(Uh...patch actually attached this time.)
Comment #6
Anonymous (not verified) commentedSince the project requires javascript, this patch removes the "add media" link completely from the admin/content/media page. I guess if users want to work without JS, they can add images to the filesystem and import.
Comment #7
robeano commentedCommitted c78f55b
Comment #8
effulgentsia commented#5/#7 broke the following:
- If you have permission to 'import media', then you don't see that action link on admin/content/media, because the js code replaces it.
- If you don't have permission to 'import media', then you don't get an 'add file' link either, because no
<ul>container gets rendered for the js code to insert into.Here's a patch against 1.x with the fix.
Comment #9
dave reidAssigning for review.
Comment #10
dave reidComment #11
devin carlson commentedAdding files is now possible without JavaScript in 7.x-2.x.
For 7.x-1.x, the Media project page lists "Javascript must be enabled in the user's browser" under requirements and I'm not so sure that having users wonder why there is no link to add media (because they have JS disabled) is less confusing then having users wonder why the add media form doesn't work.
Please reopen this issue if you think it is still valid for 7.x-1.x.