Active
Project:
Drupal Commons
Version:
7.x-3.13
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2014 at 15:38 UTC
Updated:
31 Aug 2016 at 06:28 UTC
Jump to comment: Most recent
Always i get this message :
Warning: class_implements(): object or string expected in file_get_stream_wrappers() (line 136 of /var/www/drupalcommons/web/includes/file.inc).
Warning: in_array() expects parameter 2 to be array, boolean given in file_get_stream_wrappers() (line 136 of /var/www/drupalcommons/web/includes/file.inc).
Any idea ?
Comments
Comment #1
lsolesen commentedCould you supply the exact steps to reproduce?
Comment #2
virk commentedWhen i just login as administrator i alway get this message on the top of the site
Comment #3
virk commentedNobody to help me to remove this irritating messages at the top of my site?
i using drupal commons 7.x-3.1
Comment #4
lsolesen commentedTry updating to 3.13
Comment #5
virk commentedSorry i am using 7.x-3.13 not 7.x-3.1 ...
Comment #6
alcroito commentedHi, I'm getting the same thing and I think I know where it comes from.
The $wrappers in file_get_stream_wrappers contains 2 values for the 'oembed' key.
This is what $wrappers contains.
The class_implements($info['class']) function expects the class to be a string, but in oembed's case its an array of two strings.
I believe this is happening because both the oembed and media_oembed define their own file stream wrappers.
This breaks the site form on certain pages by throwing a WSOD.
I'm using Commons 3.13.
Comment #7
alcroito commentedCommenting out oembed_stream_wrappers() fixes the issue for me, by only leaving the wrapper defined by media_oembed.
But obviously this is not a clean solution, and should be discussed with the maintainers of both oEmbed and media_oembed modules.
But there doesn't seem to be any communication or plans to making both modules work as can be seen in #2226639: Use Media: oEmbed for Media integration.
Comment #8
virk commentedPlacenta,
which file should I change?
Is the file includes/file.inc file?
Thank you.
Comment #9
alcroito commentedIts in profiles/commons/modules/contrib/oembed/oembed.module
Find oembed_stream_wrappers, and comment out that function. Note that you should do it, only if you have the media_oembed module enabled, and I haven't thoroughly tested if it breaks anything, so it's on your own risk.
Comment #10
virk commentedPlacinta,
The message has gone for the moment but ...
Thanks
Comment #11
adam_b commentedPlacinta's suggestion is working fine for me - just had to reinstate it after upgrading to Commons v7.36
Comment #12
yosigosi commentedI tried to use hook_stream_wrappers_alter in media_oemebed with no success.
So, instead of comment the function I check if media_oembed is enabled :
Comment #13
darvanenNice one @yosigosi, that did the trick for me. I'm not sure I completely understand why though, as I have the media_oembed module enabled...