Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
After upgrading to a7, I get a bunch of these errors, that did not appear in a5 or a6.
Notice: Trying to get property of non-object in file_styles_styles_filter() (line 37 of /sites/all/modules/styles/contrib/file_styles/file_styles.module).
Notice: Trying to get property of non-object in media_youtube_file_styles_filter() (line 65 of /sites/all/modules/media_youtube/includes/media_youtube.styles.inc).
Notice: Trying to get property of non-object in file_styles_styles_filter() (line 53 of /sites/all/modules/styles/contrib/file_styles/file_styles.module).
The second one can be eliminated by turning off the media_youtube module, and there's a companion bug report that was already filed for that: #1174950: Trying to get property of non-object in media_youtube_file_styles_filter()
However the first and last ones (lines 37 and 53) continue to display on all pages (even admin pop-up dialogues, like views settings).
Happy to provide more information or help troubleshoot and test. I'm running Drupal 7.2.
Comment | File | Size | Author |
---|---|---|---|
#14 | fix-non-object-in-file-styles-styles-filter-1175008-14.patch | 3.87 KB | aaron |
#10 | fix-non-object-in-file-styles-styles-filter-1175008-9.patch | 758 bytes | aaron |
Comments
Comment #1
rootworkFor reference, alpha7 inserts the following just before line 37:
Removing that will remove the errors.
Not suggesting this is a fix, just identifying the source of the errors.
Comment #2
pazap47 CreditAttribution: pazap47 commentedSame problem
Comment #3
drupnewbie CreditAttribution: drupnewbie commentedsame issue after updating from beta 5 to 7. Probably the issue is followed by same style troubles regarding the correct display of file styles (colorbox load the original file).
THX for helping
Ray
Comment #4
Aracon CreditAttribution: Aracon commentedResults of a quick research:
1) The code that gets an error (file_styles.module, line 30):
2) The variable $object when entering the function has the value:
And before the last line ($file=...):
So, maybe, some other code forms wrong object, or the object should have another structure... Because I don't know the proper structure of the object that should be passed to this function, I can't make further investigations.
3) Notices appear in media_youtube module because it relies on the same assumptions (that the $object has $object->uri and similar fields), errors appear in media_youtube.styles.inc (line 65) and in MediaYouTubeStyles.inc (line 30), maybe somewhere else. All that code relies on file_styles module, so I think that the problem is in file_styles, not in media_youtube.
Comment #5
kgc CreditAttribution: kgc commentedI had the same error:
Notice: Trying to get property of non-object in file_styles_styles_filter() (Zeile 37 von sites/all/modules/styles/contrib/file_styles/file_styles.module)
The error is shown after Update the Styles Modul to 7.x-2.0-alpha7 on all pages where images shown.
Comment #6
keha3912 CreditAttribution: keha3912 commentedconfirm error
Comment #7
davidsanger CreditAttribution: davidsanger commentedsub
Comment #8
aaron CreditAttribution: aaron commentedcrud, just figured it out -- my changes to the styles module were dependent on new changes in media that haven't been rolled into a release yet. until i figure out how to accommodate older versions of media, you can fix by updating media to the latest from git. terribly sorry... i'll try to fix asap...
Comment #9
rootworkAaron, can you confirm that's what's causing #1174950: Trying to get property of non-object in media_youtube_file_styles_filter() too? If so then I'll mark that one as a dupe and we can follow the fixing of this bug here.
Comment #10
aaron CreditAttribution: aaron commentedhere's a quick fix...
Comment #11
arievdonk CreditAttribution: arievdonk commentedsame here
Comment #12
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy commentedPatch #10 applied and worked! Videos are back and errors are gone yeahhh :p
Thanks!
Comment #13
rootworkConfirmed that the patch in #10 fixes the issue. Aaron, since you say it's a "quick fix" perhaps you want to leave this open, so I won't set the status to fixed.
I also marked #1174950: Trying to get property of non-object in media_youtube_file_styles_filter() as a duplicate, as the patch fixes that issue too.
Comment #14
aaron CreditAttribution: aaron commentedactually, this patch is more thorough, and works (for me) on both the beta4 and dev releases of media, and the latest version of media youtube. it's also cleaner.
Comment #15
rootworkYep, #14 fixes it as well. And you're right that it's a lot cleaner.
Comment #16
aaron CreditAttribution: aaron commentedgreat, thanks @rootwork! committed.
Comment #17
keha3912 CreditAttribution: keha3912 commentedthx
Comment #18
pazap47 CreditAttribution: pazap47 commentedYes perfect it works. Great job!
Comment #19
ts145nera CreditAttribution: ts145nera commentedGreat!!!
Comment #20
xpla CreditAttribution: xpla commentedStill have the following issue:
Anyone?
Comment #21
Anders Hansen CreditAttribution: Anders Hansen commentedSame here, still have the error.
Notice: Undefined property: stdClass::$uri in file_styles_styles_filter() (line 33 of /home/appnyt/public_html/sites/all/modules/styles/contrib/file_styles/file_styles.module).
Notice: Undefined property: stdClass::$filemime in file_styles_styles_filter() (line 49 of /home/appnyt/public_html/sites/all/modules/styles/contrib/file_styles/file_styles.module).
Comment #22
rooby CreditAttribution: rooby commented@xlpa & Anders Hansen:
I have opened a new issue for the undefined property errors here #1186624: Undefined property stdClass::$uri and stdClass::$filemime in file_styles_styles_filter()