Article

Media modules Fatal error: Call to undefined function media_include_browser_js() in

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:

  1. Under your contributed module directory (normally sites/all/modules/), search and find for:
    media_include_browser_js();
     
  2. Backup those modules or file/s to be edited
  3. 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:
  1. Under the same modules directory, search and find this time for:
    include_once drupal_get_path('module', 'media') . '/wysiwyg_plugins/media.inc';
     
  2. Backup those modules or file/s to be edited, if these are different from above
     
  3. 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. 
Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.