After enabling this module, when I go to edit the Context for a page, I get:

Fatal error: Class 'MediaBrowserPlugin' not found in /opt/development/mpotter/fema_gov/drupal/sites/all/modules/remote_stream_wrapper/RemoteStreamWrapperMediaBrowser.inc on line 8

We are not using the Media module. But it looks like the RemoteStreamWrapperMediaBrowser.inc is getting loaded anyway.

Seems to also happen with "drush fe". Any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Oh interesting. This seems to be a problem with the core class registry because Media is not a dependency for this module, but yet our RemoteStreamWrapperMediaBrowser.inc extends a class that only exists in Media, and we list that file in remote_stream_wrapper.info. Hrmmm.

dogoblack’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta3

Hello, I have installed the Media and yet still have that problem.

[Fri Feb 17 21:06:38 2012] [error] [client 192.168.1.36] PHP Fatal error:  Class 'MediaBrowserPlugin' not found in /var/www/ututo/sites/all/modules/remote_stream_wrapper/RemoteStreamWrapperMediaBrowser.inc on line 8, referer: http://192.168.1.37/ututo/admin/structure/types

[Fri Feb 17 21:21:20 2012] [error] [client 192.168.1.36] PHP Fatal error:  Class 'MediaBrowserPlugin' not found in /var/www/ututo/sites/all/modules/remote_stream_wrapper/RemoteStreamWrapperMediaBrowser.inc on line 8, referer: http://192.168.1.37/ututo/admin/structure/types/manage/article/fields
Dave Reid’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev

Yes, this will happen if you have Media 1.x installed or Media (doesn't matter which version) disabled.

dogoblack’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta3

Thanks for your reply. I upgraded from Media 1.X to Media 2.unestable and now is functional.

ckopack’s picture

Phew. Thank you. Media 2 unstable did take care of the job. When I ran update.php it spewed a few dependencies at me. I had to install the file entity module and go into a few module's .info files and delete version dependencies. Now it works. Thank you guys for the help.

Are there any major concerns with this release?

ckopack’s picture

PS When I try to embed a Youtube video now under the Web tab I get the error: The YouTube video ID is invalid or the video was deleted.

mholve’s picture

@ckopack, I had the same problem and had to roll back to the last "alpha" release. Problem solved, for now.

GN’s picture

I ran into the "Class 'MediaBrowserPlugin' not found" problem after performing the database update associated with media_youtube 7.x-1.0-beta2 version (which is said to "rebuild themes and formatters").
I think we need to clarify if Remote stream wrapper is dependent on Media or not?

jcisio’s picture

Perhaps a workaround is to load this inc file in hook_init()?

andyhu’s picture

Same issue here. Can we put a dependency check in .info file? So if a user install media 1.x they won't be able to enable this module?
dependencies[] = media (2.x)

Thanks!

jcisio’s picture

Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
4.5 KB

@andyhu No we can't add a dependency like this. It is not necessary to install a huge module just to use a 7 KB module.

Here is a patch that move Media related function and load them on hook_init() instead of using Drupal's autoload. I didn't test with Media, however.

jcisio’s picture

Title: Class 'MediaBrowserPlugin' not found when editing Context for a page » Module should work with Media module disabled

Status: Needs review » Needs work

The last submitted patch, 0001-Bug-1444626-Module-should-work-with-Media-module-dis.patch, failed testing.

jcisio’s picture

The 'file/add/remote' menu item use a Media plugin access check (I don't know why). But this new patch fix that, too.

morphosis7’s picture

Am I correct in understanding, from this discussion, that the -beta3 version of remote_stream_wrapper is dependent upon the 2.0-unstable branch of the media module? This would match what I've observed here, but I want to make sure I follow everything correctly. If this is correct, where can I find a discussion about why this step was taken? I'm generally reticent to implement modules in an unstable release, but have not yet looked into why media 2.x has been labelled this way.

jcisio’s picture

Status: Needs work » Needs review

@morphosis7: no it is not dependent on Media 2, but it does support Media 2 integration. However, a "bug" in Drupal core turns this integration into dependency.

Shellingfox’s picture

@jcisio

The permission callback on hook_menu() still callback to RemoteStreamWrapperMediaBrowser::access, which extends MediaBrowserPlugin. This will make the MediaBrowserPlugin need to load, that mean we still need media module here.

jcisio’s picture

#17 That why I added a check in hook_menu() the latest patch #14 ;-)

VladSavitsky’s picture

I only want to confirm that beta3 has this bug. Down graded to beta2.

morphosis7’s picture

@19 this is what I'm thinking of doing too - were there any schema changes you had to back out of? I didn't see any, but wanted to confirm.

Dave Reid’s picture

Assigned: Unassigned » Dave Reid

Downgrading for now should work fine. I am actively trying to fix this today.

Dave Reid’s picture

Please test the following patch.

Dave Reid’s picture

Status: Needs review » Fixed

The patch in #22 was included with http://drupalcode.org/project/remote_stream_wrapper.git/commit/cdc7b0c and is now considered fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

vlajkop’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta4
Status: Closed (fixed) » Active

This is still issue. Remote URL is not showing for media 7.x.2. module versions. I have installed next modules: Media 7.x-2.0-unstable3 Remote stream wrapper 7.x-1.0-beta4 . I tried all versions and combinations and it seems that Remote stream wrapper just doesn't support media 7.x.2 module versions.

With stable Media 7.x-1.0 or dev version it is working, but there is issue with modal widow selecting and setting file. When "Remote URL" is used modal window won't close & Javascript error "this.contentWindow.Drupal.media is undefined" is raised. This happen anywhere where remote URL is used. Selecting content using other plugins works fine. Error seems to be in how remote url handles selecting content and using media.popups.js.

Full error: "Timestamp: 4/10/2012 4:30:26 PM
Error: this.contentWindow.Drupal.media is undefined /sites/all/modules/media/js/media.popups.js Line: 103
Source File: xxxxxxxxxx/sites/all/modules/media/js/media.popups.js?v=7.x-1.0+4-dev
Line: 103" Same and for non dev version.

Similar problem is reported here http://drupal.org/node/1396700

Please if someone have ideas about solutions for those issues let me know.

For now I will have to downgrade Media module to 7.x.1 version, but I'm very interested in solution for this.

Dave Reid’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Active » Fixed

I've just confirmed the latest Media 7.x-2.x works just fine with Remote stream wrapper 7.x-1.x. If you are trying to display remote images using the Rendered file formatter, then the problem is with #1358860: File Entity won't render image derivatives for images stored using non-local stream wrappers which is a bug in file_entity. Your media browser submission issue should be handled with #1396700: Media Browser "View Library" Submit button redirects back to homepage, instead of closing modal and adding media file and not in this issue. As I've confirmed that this functionality still works, I'm going to mark this back as fixed.

vlajkop’s picture

Hi Dave,

Thank you for responding so fast.

I'm not sure what is wrong here or what I'm missing, but with all 7.x.2 branch of media and latest Remote stream wrapper 7.x.1.0-beta4 "Remote URL" plugin is not displaying. I have checked couple of times and settings when selecting all plagins, none or Just Remote URL, but result is always the same. There is no Remote URL plugin displayed as option for files. In different drupal installation with same setting if I use Media 7.x.1.x module this plugin is displayed as option when setting files in admin area.

Only thing that I haven't check is setting that says that my field has 2 values. I really don't have idea why this Remote URL is not showing and what may be a reason. Would you please post what modules have you used in your test and how your field was set? Mine is as file, using as formatter media and with settings that has 2 values.

Thank you very much for looking into this. Please let me know if you like some more details.

Dave Reid’s picture

Ah, you need to ensure that your user role has the 'Add media from remote URLs' permission assigned.

vlajkop’s picture

Add media from remote URLs was selected for administrator. I also enable this for all roles, but nothing changed - no luck.

vlajkop’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta4

Any other ideas? I can setup new drupal installation on my testing machine and start installing modules from start in order to see when this issue will start appearing. Is there any order of installing modules that is advisable?

vlajkop’s picture

Status: Fixed » Active
FileSize
255.2 KB
308.14 KB

After installing fresh installation of drupal (http://www.acquia.com/downloads Acquia Drupal 7.12.13) and only next couple of modules:

Chaos tools 7.x-1.0 ; File entity 7.x-2.0-unstable3+21-dev ; Media7.x-2.0-unstable3 ; Media Field7.x-2.0-unstable3 ; Media Internet Sources7.x-2.0-unstable3 ; Remote stream wrapper7.x-1.0-beta4 ; Views7.x-3.3

“Remote URL” plugin is not displayed under admin/content/file or under content type that is using file type with media selector widget.

All file sources & plugins are selected. Account in use in this testing is administrator where this role has access to everything and all permissions are selected.

Please check attached images for more clues.

I'm completely lost and not sure what I'm missing here. Please advice if anyone has any idea how to solve this issue or if some other combination of modules work with remote file please provide a list.

Thanks in advance,
Vlajko

twistor’s picture

Assigned: Dave Reid » Unassigned
Issue summary: View changes
Status: Active » Fixed

@vlajkop, The issue reported in the original summary was fixed a while ago. If you're still having problems, please open a new issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.