After I upgraded from ImageCache 5.x-2.0-beta to 5.x-2.0-rc1, no images are displayed in my CCK nodes, nor in my views. For the CCK nodes, I'm using the default CCK 'Display fields' settings. My views are list views, using the fields option settings to display an ImageCache preset.

I tried emptying Drupal's cache, Views' cache, flushing the ImageCache presets, disabling/enabling ImageCache & UI module.

Should I do anything special to upgrade from ImageCache 5.x-2.0-beta to 5.x-2.0-rc1?

CommentFileSizeAuthor
#16 254368_formatter_names_01.patch1017 bytessoxofaan

Comments

brunodbo’s picture

"(...) I'm using the default CCK 'Display fields' settings (...) "

I meant: I'm using the CCK 'Display fields' settings. Not the default ones: I did select an ImageCache preset.

rootwork’s picture

Priority: Normal » Critical

I'm having exactly the same problem -- after upgrading, all of my cached images refuse to appear, even after taking the steps mentioned above. I even tried deleting the images on a node and re-adding them, but that doesn't fix it.

I have one piece of information that may help address this issue: When I use the devel module to look at the variables that are rendered, in the image field's view attribute I see the following note:

What's odd is that the imagecache formatter I have is named "candidate_images," and that's how it's set to display on the node (where it's not appearing) and in a view (where it's not appearing). So I'm wondering if somehow the underscore is throwing off imagecache.

It could be something else, but I thought I'd give as much info as I have about the issue.

rootwork’s picture

Yep, that was it. I tried renaming the presets by removing the underscores; when I returned to the node it was trying to render the image but not finding the original file. Deleting and re-adding the file fixed it, and now it's rendering them.

So there must be some bug in dealing with underscores, and since I don't want to rename all of my presets, update all of my templates and delete and re-add all of my images, I think I'm going to bump back down to the beta until rc2 addresses this.

And sorry I'm not a good enough programmer to be able to submit a patch.

brunodbo’s picture

Confirming that images are rendered and displayed correctly when underscores are removed from presets' names. Hyphens work fine, btw.

brunodbo’s picture

Steps I needed to do to get my images rendered again:

- change preset name (remove underscore)
- for views: re-selecting the desired preset under the view's fields' options (after renaming the preset, it jumped to the first preset available) & re-save the view
- for cck content types: re-selecting the desired preset on the 'display fields' page & re-save the content type's 'display fields' settings

dopry’s picture

Status: Active » Postponed (maintainer needs more info)

Did you try clearing your cache?
SQL: DELETE from cache, or TRUNCATE cache
Devel module: Empty Cache

Sometimes old preset settings get stored there...
I use presets with underscores pretty regularly.

Can you go back to the previous state and test again with just clearing drupal's cache.

brunodbo’s picture

Yep, I tried fixing the problem by clearing Drupal's cache. That didn't help however.

jonhattan’s picture

dopry: It's not a caching issue. replacing the rc2 folder with -beta folder does fix the problem immediately.

I have take a look to the code and seen a problem at line 555 :) :

list($presetname, $style) = explode('_', $formatter);

this is not compatible with having presets with underscodes. I've replaced it with the following code and I got a step further, but seems to not work still:

  $pieces = explode('_', $formatter);
  $style = array_pop($pieces);
  if (count($pieces) > 1) {
    $presetname = implode('_', $pieces);
  }
  else {
    $presetname = $pieces[0];
  }
dopry’s picture

jonhattan,

thats the exact bug I found yesterday..
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/imagecache/...

It shoudl already be fixed in HEAD... give it a try... the dev release should have the fixes.

dopry’s picture

Status: Postponed (maintainer needs more info) » Fixed

oh yeah.. fixed.

DerTobi75’s picture

Hi,

I am still experiencing this issue with RC2 ;(

Tobi

DerTobi75’s picture

Dropy,

it seems like, that now presets without underscore are not rendered!

Tobi

tanc’s picture

I'm having the same problems with rc2. Have emptied cache etc. I've removed the underscores which helped a little but the issue now is that the imagecache images will only display if the content type's display fields are set to 'mypreset as link to node'. Selecting just 'mypreset' causes no image to be shown.

Downgrading the module to 2 beta allowed the standard 'mypreset' to work but no 'mypreset as link to node', almost the opposite effect...

DerTobi75’s picture

Hi,

what if you rename your preset to: my_preset? This should work.

Regards,

Tobi

almich’s picture

Version: 5.x-2.0-rc1 » 5.x-2.0-rc2
Status: Fixed » Active

Hi,

I updated to rc2 and I can't see the images, either. Instead in the source code there can be found the comment <!-- imagecache formatter preset() not found! -->. So I looked closer to the module code, the problem still seems to be line 556ff:

$parts =  explode('_', $formatter);
$style = array_pop($parts);
$presetname = implode('_', $parts);

In my case $formatter is a string without underscore. $parts becomes an array with just one element, $style is then a string again, identical to $formatter. And in the end $presetname seems to be an empty String, which obviously leads to an error message.

Regards, almich

soxofaan’s picture

Title: Upgrade from v2.0-beta to v2.0-rc1 » imagefield formatter problem with underscores
StatusFileSize
new1017 bytes

marked http://drupal.org/node/254368 as a duplicate of this issue

I attached my patch from that issue here.
It just makes sure all formatters have the same structure "$presetname_$style", so that the explode-pop-implode trick works for all cases

(@brunodbo: hi bruno)

TC44’s picture

same problem here. I'll try the patch later today.

brunodbo’s picture

Confirming that 254368_formatter_names_01.patch by soxofaan works. Images are rendered correctly, with or without underscores in preset names.

@soxofaan: Thanks!

dopry’s picture

Status: Active » Closed (fixed)

oh sorry I fixed that in HEAD and never backported to DRUPAL-5--2... Back ported now.. should show up in dev release tomorrow. I may roll another RC later today.

a_c_m’s picture

Please do roll a new RC, downloaded RC2 today and ran into this problem.

sun’s picture

Component: Miscellaneous » Code
Category: support » bug
Status: Closed (fixed) » Fixed

+1 for RC3.

Anonymous’s picture

Version: 5.x-2.0-rc2 » 5.x-2.0

To get this bug to clear up on the 2.0 release, you have to poke at your CCK field formatters by flipping them to another option and flipping them back.... at least that was my experience.

mikl’s picture

I have been trying to find the where the selected formatter (CCK display fields settings) is stored in the database, but so far I've not been able to.

Does anyone know?

Anonymous’s picture

They're stored in a serialized variable in the node_field_instance table, so you're better off working with them in PHP.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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