As of Drupal Media module version 2 and 3, there are a lot of modules, contributed or custom which have yet to upgrade its code to complement with Media’s major overhaul. Notably, this error I kept encountering with Drupal 7 projects:
Fatal error: Call to undefined function media_include_browser_js() in
To troubleshoot and fix this:
- Under your contributed module directory (normally sites/all/modules/), search and find for:
media_include_browser_js();
- Backup those modules or file/s to be edited
- Comment out that line or lines found, then replace with:drupal_add_library(‘media’, ‘media_browser’);drupal_add_library(‘media’, ‘media_browser_settings’);
Clear and flush all cache. Refresh page.
Another error might appear:
Warning: include_once(sites/all/modules/media/wysiwyg_plugins/media.inc): failed to open stream: No such file or directory in include_once() (line
To fix this, do the following:
- Under the same modules directory, search and find this time for:
include_once drupal_get_path(‘module’, ‘media’) . ‘/wysiwyg_plugins/media.inc’;
- Backup those modules or file/s to be edited, if these are different from above
- Comment out that line or lines found, the location of the plugin below needs to be updated to:
include_once drupal_get_path(‘module’, ‘media’) . ‘/modules/media_wysiwyg/wysiwyg_plugins/media.inc’;
Clear and flush all cache. Refresh page.