Something in styles.module changed causing problems. Patch coming.

#1 undefined_property-1203252-1.patch1.02 KBlangworthy
Members fund testing for the Drupal project. Drupal Association Learn more


langworthy’s picture

The second change fixed the problem for me. Assuming the first change should be made for consistency.

And this happened to me when using media.module HEAD, media_youtube.module HEAD and field_styles.module 7.x-2.0-alpha8

Patch formatted for drush_make

dddave’s picture

Status: Active » Needs review

Applied by hand and it works. Thanks!

Carlos Miranda Levy’s picture

I confirm this works and fixes the problems created by latest versions of media, entity, styles, and all the patches applied to fix them.

aaron’s picture

Status: Needs review » Fixed

thanks. that didn't work for wysiwyg; applied a fix for both.

cajinx’s picture

was wondering if you could please explain where to place the patch code, I need to insert by hand (not doing drush). Any explanation or directions would be greatly appreciated. ty.

dddave’s picture

Just wait for the next dev and download. aaron has committed the fix so there is no need to do it yourself.

Generally to apply a patch by hand you have to check which files to modify (usually in the top line of the patch but look out for further files mentioned within the patch). After that locate the line in the file which should be modified (the one with the - in front of it) and replace it with the line with the +. This is feasible for patches modifying only one line here and there (like this one) but in general not that fun.

Status: Fixed » Closed (fixed)

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

BeaPower’s picture

worked, thanks

cgonsalv’s picture

•Notice: Undefined property: stdClass::$file in media_youtube_file_styles_filter() (line 65 of /home/badmin6/public_html/
•Notice: Trying to get property of non-object in media_youtube_file_styles_filter() (line 65 of /home/badmin6/public_html/

I get the above error messages even after applying the patches below

The error is occuring on the node that has a multimedia field which includes a youtube video.

However in the teaser view of the node a screen capture of the youtube video is shown which is the expected behaviour.


jkaine’s picture


I had this same problem, but came to the discussion late. It turns out that a patch to the Styles module (per this reference: ) fixes this problem for Media: Youtube, plus others.

I'm running D7.8 + Media 7.x-1.0-beta5 + Media: Youtube 7.x-1.0-alpha5

Upgrading to Styles 7.x.2.x-dev (September 12) got rid of all these errors, and that was WITHOUT applying the patch from #1.

I haven't tested to see if the patch from #1 conflicts with the change to Styles-- I kinda doubt it-- but it might be a bit of cruft if they've actually fixed the problem with Styles.


PS: Media: Youtube has saved me quite a bit of time. Thanks for the module.

damien_vancouver’s picture

I also had this problem, whenever I tried to display a youtube media field in any kind of style. I was running styles-7.x-2.0-alpha8.

As per #10, I upgraded styles to 7.x-2.x-dev 2011-Sept-12, and the error went away without any patching.

Hopefully a new recommended release comes out soon for styles, which would stop people encountering this problem.