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
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

leanazulyoro - June 21, 2008 - 20:23

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

bimbo000 - June 30, 2008 - 18:42

I have the same problem... any solution?

#3

studioz - July 3, 2008 - 19:01

Same problem. Subscribing.

#4

silviogutierrez - July 4, 2008 - 03:46
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

#5

havran - July 4, 2008 - 05:39
Status:postponed» active

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

#6

strawman - July 4, 2008 - 23:25

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

noslokire@drupal.org - July 21, 2008 - 21:28

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

#8

Zoologico - August 15, 2008 - 03:40

:(
Tracking.

#9

sageroo - August 15, 2008 - 04:19

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

paulnem - September 29, 2008 - 19:04

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

#11

silviogutierrez - October 2, 2008 - 01:17
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

#12

ncameron - October 17, 2008 - 08:34

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

jun - October 24, 2008 - 09:14

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

Thanks!

#14

obrigado - October 26, 2008 - 23:45

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

fuquam - August 7, 2009 - 17:25

Very nice Neil. Thank you.

- Scott

 
 

Drupal is a registered trademark of Dries Buytaert.