When trying to embed a youtube video, I get an error Fatal error: Call to undefined method MediaYouTubeStyles::get_uri() in /sites/all/modules/media_youtube/includes/media_youtube.styles.inc on line 159

Comments

dema502’s picture

StatusFileSize
new832 bytes

Hi Nigel

I think is it because Styles Module change API.

Carlos Miranda Levy’s picture

I confirm this patch fixes the issue for me.
Applied to alph4 version.
Just download patch to your sites/all/modules/media_youtube/includes directory and apply from there...

cd sites/all/modules/media_youtube/includes
wget http://drupal.org/files/issues/styles_0.patch
patch < styles_0.patch
mattash’s picture

After applying this patch, Youtube embeds were properly rendered, but preview thumbnails now no longer work. The img tag is rendered with src points to the URL of the Youtube video.

r0bm1lls’s picture

Confirm embedded video work now but no thumbnail and when editing using wysiwyg the image does not appear. Not through the woods yet... Thanks for interim patch though.

dema502’s picture

StatusFileSize
new1.13 KB

Patch with fix thumbnail

dema502’s picture

And remember to clear cache after patching!

mattash’s picture

StatusFileSize
new2.53 KB

I had a few other problems with the media_youtube.styles.inc file. Here is my modified patch. Note: This includes the changes from the patch in comment #1 and #5.

Anonymous’s picture

patch in #7 solves my problems, thanks !

Carlos Miranda Levy’s picture

Patch #7 fixes all.

tomfilepp’s picture

It looks like if you just change all instances of lowercase 'youtube' to 'vimeo' and all capitalized instances of YouTube to Vimeo in the patch file, it also fixes this issue for the Vimeo style module.

aaron’s picture

Status: Active » Closed (duplicate)
Carlos Miranda Levy’s picture

Pardon my ignorance... but what do I do with http://drupalcode.org/project/media_youtube.git/commit/7358b9e ?

Should I download the patch link as a file and apply it as a patch?

Not too familiar with the git repository for drupal, sorry for asking.

aaron’s picture

ah, no, sorry. you don't need to patch, you can update to alpha-5, as it's applied there. though you can download the patch and apply it from http://drupalcode.org/project/media_youtube.git/patch/7358b9e?hp=2e45bc3... if you really want.

Carlos Miranda Levy’s picture

Thanks for quick reply. Is this patch also applied to the 7.x-1.x-dev version? I'm now battling other issues (styles related) and would like to know if eventually it would be "safe" to test the dev when dealing with further errors and not lose the applied patch.

cpelham’s picture

I have latest dev (June 1 I think) and I am getting an almost identical error (line number is different):

Fatal error: Call to undefined method MediaYouTubeStyles::getUri() in /home/cpelham/public_html/dev.crsny.org/public/sites/all/modules/media_youtube/includes/MediaYouTubeStyles.inc on line 37

I get the error when I try to edit any file style.