Hello I'm using:
Drupal: 7.16
Media: 7.x-2.0-unstable6
Media Browser Plus: 7.x-2.x-dev from 19. October

after Updating to the newest Version of Media Browser Plus i always get this Error if i try to add a Media with the WYSIWYG Button:
Fatal error: Cannot instantiate abstract class MediaBrowserLibrary in /www/htdocs/XXXX/sites/all/modules/media/includes/media.browser.inc on line 76

It's also described in this: #1818000: Fatal Error after upgrade to 7.16 Issue.
I think it's a MBP issue, caused by this patch: #1804570: "Library plus" is not functioning

Hope for Help :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nightwalker3000’s picture

I've now found a Workaround by partially revert the Commit from 18. October:

Override the whole file:
sites/all/modules/media_browser_plus/includes/MediaBrowserPlusLibrary.inc

with this Code:


class MediaBrowserPlusLibrary extends MediaBrowserPlugin {

  function view() {
    $types = isset($this->params['types']) ? $this->params['types'] : array();
    $multiselect = isset($this->params['multiselect']) ? $this->params['multiselect'] : FALSE;

    // Get plugin form.
    $upload_form = drupal_get_form('media_browser_plus_library_browser', $multiselect, $types);
    $upload_form['#title'] = t('Library Plus');

    $upload_form['admin']['#markup'] .= l(t('Cancel'), '', array(
      'attributes' => array('class' => array('button', 'fake-cancel', 'library_plus'))
    ));

    return $upload_form;
  }

}

We're deleting the the compatible for the newest MediaBrowserPlugin class but Media Works again :)

If you not Copy/Paste from above, take care that the Class decleration must be change from:
class MediaBrowserPlusLibrary extends MediaBrowserLibrary
to:
class MediaBrowserPlusLibrary extends MediaBrowserPlugin

TechNikh’s picture

I fixed my issue by modifying MediaBrowserPlusLibrary.inc code with

// Latest media version.
require_once(drupal_get_path('module', 'media') . '/includes/MediaBrowserLibrary.inc');

class MediaBrowserPlusLibrary extends MediaBrowserLibrary {
firebird’s picture

Here's the change from #1 rolled into a patch.

firebird’s picture

Oops. Try this one instead.

JimmyAx’s picture

Priority: Major » Critical
Status: Active » Reviewed & tested by the community

Bumping this one as it prevents attaching any media.

The patch in #4 applies fine and solves the problem for me. Looks RTBC.

kbasarab’s picture

I had this same error without using the WYSIWYG option. In my case it happened when opening the Media Browser directly from the Select Media button. Patch in #4 applied and resolved error for me as well.

salvis’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)