Closed (outdated)
Project:
Styles
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 May 2010 at 01:22 UTC
Updated:
11 Jun 2025 at 13:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
elliotttf commentedsubscribing... I'm seeing the same thing.
Comment #2
Scott J commentedI think that I answered my own question: "There is no problem if I leave my display format as 'Generic file'."
Filefield styles are meant to be applied to 'files', not 'images'. In a sense, image files are already styled.
Comment #3
crizconfirmed.
Comment #4
Jackinloadup commentedIm having a similar if not the same issue. Here is the error I get when formatting an image in views.
Undefined property: stdClass::$uri in file_styles_styles_formatter_filter() (line 102 of /sites/all/modules/styles/contrib/file_styles/file_styles.module).
I get this error when using 7.x-1.0-alpha4 and 7.x-1.x.dev
Comment #5
effulgentsia commentedI marked #921768: Notice: Undefined property: stdClass::$uri in file_styles_styles_formatter_filter() a duplicate, but it contains additional information.
The problem is the object passed to theme('styles_field_formatter'). Currently it's the entity containing the field, but that makes no sense. It needs to be the field item. Here's a fix for that. Note, for the use-case of Media module, it makes no difference, since the media entity containing the file field and the file referenced by that field are one and the same. But for any other use-case, there are bugs like the ones reported here.
Comment #6
effulgentsia commented.
Comment #7
JacobSingh commentedSeems okay to me, but I didn't really get a chance to look at it in context. Are there any other consumers of this API who will be surprised when the signature changes?
Comment #8
effulgentsia commentedTurns out media_youtube.module isn't happy with #5, because it has a theme function relying on information that's in the entity but not the field data. Will post another patch soon, along with tests.
Comment #9
effulgentsia commentedIdeally, still needs tests, but I have other priorities I need to get to first. Posting this here in case it's useful to people, and in case one of the project maintainers wants to commit this without waiting for tests to be added. It's possible there are some modules using Styles for whom this change will break things, though I suspect that's less likely than the #5 patch.
Comment #10
aaron commentedi haven't been alerted to any modules other than the media suite that are currently using the d7 branch of styles. there are some others using d6, but this obviously won't affect that, and considering that fields/entities work differently in d6, there should be nothing to backport anyway. i'm committing this, and setting to needs work for the tests.
thanks, @effulgentsia!
Comment #11
aaron commentedComment #12
aaron commentedchanging title...
Comment #13
aaron commented@effulgentsia: do you happen to remember what blocked the patch in #5 from working for media: youtube? i've refactored styles to work better with media, and ran into issues that would be readily resolved with that patch rather than some hair-raising hacking i've got in place right now.
Comment #14
aaron commentednm, found it in the code documentation. thanks!
Comment #15
geek-merlincrosslinking: there is another patch at #1186624: Undefined property stdClass::$uri and stdClass::$filemime in file_styles_styles_filter()
Comment #16
bluegeek9 commentedThank you for your contributions to this issue. As Drupal 7 has reached its End of Life and is no longer supported, we are closing this issue. We encourage you to upgrade to a supported version of Drupal.