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.
Limiting media browser plugins visibility with user permissions cause the whole media browser to crash.
The error message is Fatal error: Unsupported operand media.browser.inc on line 52.
This happens because media browser is unable to handle empty responses from plugins that the user isn't allowed to use.
Patch to fix this bug is provided in this post.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1565448-empty-browser-tab-output.patch | 732 bytes | Dave Reid |
media-browser-empty-plugins.patch | 533 bytes | attekilpela | |
Comments
Comment #1
attekilpela CreditAttribution: attekilpela commentedComment #2
Dave ReidI've confirmed the issue in theory (the proper way to limit permissions is to perform the user_access() checks in hook_media_browser_plugin_info() and not in the actual browser plugin) but here's an alternative patch that backports some of the defensive code to prevent an error in this case.
Comment #3
Dave ReidCommitted #2 to Git with http://drupalcode.org/project/media.git/commit/a820a49. Thanks!