Compatibility with imagecache 5.x-2.0
jajathejazzcat - May 26, 2008 - 22:12
| Project: | CCK Multimage |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed |
Jump to:
Description
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?

#1
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?
#2
I have the same problem... any solution?
#3
Same problem. Subscribing.
#4
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
#5
Here is solution (simple patch) http://drupal.org/node/214208...
#6
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...
#7
Same problem as above, took a look at the inline patch as well, same confusion there.
#8
:(
Tracking.
#9
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?
#10
Hi, any luck with getting this to work? Would some money move the process along?
#11
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
#12
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
#13
It did it for me as well, I think this change should be included in the 5.x.1.1 branch.
Thanks!
#14
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.
#15
Very nice Neil. Thank you.
- Scott