There is a undefined function on line 34 /styles/contrib/file_styles/file_styles.module. I create a CCK field of type file, not image, and when you chose to display the field using styles template you got this error when showing the node. If i remove the function in the file the node load correctly.

Fatal error: Call to undefined function file_uri_to_object() in /sites/all/modules/styles/contrib/file_styles/file_styles.module on line 34

function file_styles_styles_filter($object, $element = NULL) {
  // Ensure we're working against the fully loaded file object.
     $file = file_uri_to_object($object->uri);   // line 34
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aaron’s picture

Status: Active » Needs review
FileSize
2.44 KB

guess we can't always depend on this being used in conjunction with the media module, where that's currently defined. here's a patch with a new function:

aaron’s picture

Status: Needs review » Fixed

and committed.

sw3b’s picture

Cool thanks !

johnv’s picture

Version: 7.x-2.0-alpha5 » 7.x-2.x-dev
Status: Fixed » Needs work

Hm, I have updated to styles 7.x-2.x-dev (2011-Mar-12) , but still get the message:
Fatal error: Call to undefined function file_uri_to_object() in /all/modules/styles/contrib/file_styles/file_styles.module on line 33 .
When I open my php-file, the patch is not in . Is this patch really committed?
BTW, there are 2 branches. Which to take?

berenddeboer’s picture

I also still get the same error. Applied patch, but then got:

styles/contrib/file_styles/includes/themes/file_styles.theme.inc on line 33

berenddeboer’s picture

Here the patch that should be applied to 2.x-dev. It includes the patch above.

lelizondo’s picture

Status: Needs work » Needs review

patch in #6 works for latest version of styles cloned from git. moving this to needs review to test

aaron’s picture

Status: Needs review » Fixed

hmm... not sure what happened. it's there now, however: http://drupalcode.org/project/styles.git/commitdiff/804d71d?hp=609ea7081...

Status: Fixed » Closed (fixed)

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