Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I was looking in the permission setting the way to show the selection browser only but not the upload options. If you have a role that only are going to be able to select images and don't upload it (because can screw it) So the browser need other permission.
Comment | File | Size | Author |
---|---|---|---|
#12 | add-media-browser-access-permission-2048359-12.patch | 846 bytes | joseph.olstad |
#8 | add-media-browser-access-permission-2048359-8.patch | 4.13 KB | Devin Carlson |
#5 | select-media-browser-2048359-5.patch | 939 bytes | killua99 |
#1 | select-media-browser-permission-fix.patch | 1.05 KB | killua99 |
Comments
Comment #1
killua99 CreditAttribution: killua99 commentedAnd the patch ... that I forgot to attach.
Comment #2
Devin Carlson CreditAttribution: Devin Carlson commented1: select-media-browser-permission-fix.patch queued for re-testing.
Comment #4
killua99 CreditAttribution: killua99 commentedNew patch
Comment #5
killua99 CreditAttribution: killua99 commentedNeed remove the callback function. So the permission will work without any issue.
Comment #8
Devin Carlson CreditAttribution: Devin Carlson commentedAccommodated the introduction of the permission in the existing tests and added an update function to grant the permission to users who were already able to access the browser.
Also related is #1505120: Show an 'empty' tab if the user has no access to any browser plugins.
Comment #9
Devin Carlson CreditAttribution: Devin Carlson commentedDeployed #8 on a number of existing sites and didn't have any issues with existing users not able to access the media browser after running the update function.
Committed #2 to Media 7.x-2.x.
Comment #11
joseph.olstadApplying patch 8 left us with a permissions denied issue because the permission 'create files' didn't exist in our schema.
Copy from 'administer edit media' instead.
I should really put this in another issue and reference 2048359 (this one) , but here's a patch for the patch in comment #8 (apply the one from #8 first, then this)
Edit 7226 so as to not break other patches after (there's already a 7227 in another patch) , just fix this 7226 once for the next release...
BEFORE
NEW CODE (had to test it as a higher number 722x for testing increase x as number desired)
See patch
Comment #12
joseph.olstadcomment 11 should have contained this file
Comment #13
joseph.olstadclosing this , this creeped in because of a few bad changes to the media.install file that we ran various versions of. Our schema was out of sync and media_update_7226 never ran so we synched the schema it with code in the function seen below
Just call this function from somewhere within a drupal module and it will re-sync your schema. This way at least your schema will be in sync. This function scans all modules for schema issues and automatically fixes them.
sort of related patch
Or you can just use this drush script (after unzip make sure to change the first line of the script with the path to drush for your environment)