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.
In certain cases I can't fully describe (however it's a persistent issue) no information is retrieved from
function media_media_browser_plugin_info()
since file media.media.inc doesn't get included.
Comment | File | Size | Author |
---|---|---|---|
#1 | media_plugin_info-1751132-1.patch | 432 bytes | lex0r |
Comments
Comment #1
lex0r CreditAttribution: lex0r commentedThe patch (rolled against commit 738a19921453979a2aeaffcca2a66a0b5192beb0)
Comment #2
Dave ReidI could use more information on what this happens. The module implements should be assumed to work and we shouldn't have to call this manually. I haven't experienced this recently on any of my sites, so maybe it's something specific to your install? Are you able to reproduce this with a fresh install of core + CTools + Views + File entity + Media?
Comment #3
wodenx CreditAttribution: wodenx commentedI can confirm that this is still a problem with 7.x-2.x-unstable6+39dev
The hook is not invoked unless the file (media.media.inc) is loaded, because of the file_exists() check in module_invoke_all().
This is an intermittent problem because media caches the media info array -- so if media_get_browser_plugin_info() is called on one request in which media.media.inc has been loaded, the info will be available for subsequent requests even if that file is not available ... until the cache is cleared.
Probably the easiest way to reproduce the problem is to clear the cache immediately before trying to open the media browser modal from a media field.
Another solution would simply be to move the hook implementation into media.module.
Comment #4
Chris Gillis CreditAttribution: Chris Gillis commentedI was encountering this exact same issue on version 7.x-2.0-alpha2+10-dev. I upgraded module to 7.x-2.0-beta1 and the issue disappeared instantly. Based on that, this seems to have been fixed.