I just upgraded to imagecache 5.x-2.0 and received the following error when I tried to edit multimage under CCK Multimage Settings.

Fatal error: Call to undefined function _imagecache_get_presets() in /var/www/sites/all/modules/cck_multimage/cck_multimage.module on line 141

Would it be possible for you to add compatibility with imagecache 2.0?

Comments

leanazulyoro’s picture

i need this too please, imagecache 2.0 is great and i'd really like to use it, is there a patch to make it work?

zbombicz’s picture

I have the same problem... any solution?

rodneireis’s picture

Same problem. Subscribing.

silviogutierrez’s picture

Status: Active » Postponed

I will take a look at imagecache 2.0; it looks like a great update. Once I figure out how to hook unto it, I'll probably update this module.

Silvio

havran’s picture

Status: Postponed » Active

Here is solution (simple patch) http://drupal.org/node/214208...

strawman’s picture

Thats seems to be for the inline module...not sure how that works with multimage module...though I did try just changing the function name in the multimage module and it sort of worked...it then gave me an error in the common.inc about an illegal offset...Anyways...another look into this would be great as I am running into the same issue and am trying to solve this...

noslokire@drupal.org’s picture

Same problem as above, took a look at the inline patch as well, same confusion there.

Zoologico’s picture

:(
Tracking.

sageroo’s picture

I am getting the same error. The problem being is that I am not utilizing the inline module so I am not sure why the patch would be written for that module and not the ImageCache module. Anyone have any thoughts?

paulnem’s picture

Hi, any luck with getting this to work? Would some money move the process along?

silviogutierrez’s picture

Status: Active » Postponed

This module will be migrated to Drupal 6.x soon; it will require the new imagecache 2.x API.

I have no plans of maintaining a 5.x version anymore.

Silvio

ncameron’s picture

Here's a quick and dirty fix. This should probably be turned into a patch or somehow 'officiated', I'm not a big fan of ad hoc changes to module files but when you have to deliver, c'est le vie.

So here's what to do. Open up cck_multimage.module. Go to line 145 and add the below code (but NOT the php tags).

<?php
  // line 137:
  // Neil's mod to make imagecahce 2.0 presets work. Based on drupal.org/node/214208 
  $presetsIM = array();
  $presets_tmp = imagecache_presets();
    foreach ($presets_tmp as $id => $presetIM) {
    $presetsIM[$preset['presetid']] = $presetIM['presetname'];
  }
?>

Now you need to change two things just below this

Around line 148 (after adding the above code):
<?php
 '#options' => array('' => 'Full size image') + drupal_map_assoc(_imagecache_get_presets()),
?>
goes to:
<?php
'#options' => array('' => 'Full size image') + drupal_map_assoc($presetsIM),
?>

and again.....

Around line 158 (after adding the above code):
<?php
 '#options' => array('' => 'Full size image') + drupal_map_assoc(_imagecache_get_presets()),
?>
goes to:
<?php
'#options' => array('' => 'Full size image') + drupal_map_assoc($presetsIM),
?>

This did it for me.

Cheers,

Neil

jun’s picture

It did it for me as well, I think this change should be included in the 5.x.1.1 branch.

Thanks!

obrigado’s picture

I had to change from:
$presetsIM[$preset['presetid']] = $presetIM['presetname'];

to:
$presetsIM[$presetIM['presetid']] = $presetIM['presetname'];

To get the fix in http://drupal.org/node/262999#comment-1063713 to work.

fuquam’s picture

Very nice Neil. Thank you.

- Scott