The major rewrite of Imagecache breaks the compatibility with the inline module.
In fact, lot of functions of Imagecache (looking for a better code compatibility and readability) has been renamed.

I find that the collaboration between Inline and Imagecache is the best way (most intuitive one) to insert images on posts and manage them with minor hassle.

An imagecache_compat.module was planned, but the author is not going to release this compatibility layer anymore.
Could we find support in the Inline developmment?

Is possible an Inline-side update to get this working with the new version of Imagecache?
Thank you a lot!

Comments

havran’s picture

Status: Active » Needs review

Here is moddification latest Inline for Imagecache 2 (add + lines into inline.module from line 83):

  if (module_exists('imagecache')) {
    $options     = array();
    $options[''] = 'No Imagecache processing';
+    if (function_exists('_imagecache_get_presets')) {
+      // for Imagecache < 2.0
+      $presets   = _imagecache_get_presets();
+    }
+    else {
+      // for Imagecache 2.0
+      $presets = array();
+      $presets_tmp = imagecache_presets();
+      foreach ($presets_tmp as $id => $preset) {
+        $presets[$preset['presetid']] = $preset['presetname'];
+      }
+    }
    foreach ($presets as $id => $name) {
      $options[$name] = $name;
    }
sun’s picture

Category: support » task
Status: Needs review » Needs work

I need a proper patch (see http://drupal.org/patch/create) and I would like to see the same code as in #259471: Update for ImageCache 2 API

havran’s picture

Status: Needs work » Needs review
StatusFileSize
new2.13 KB

Here is patch.

sun’s picture

Status: Needs review » Needs work

I think you accidentally removed '!presets' => from the fieldset description, so the ImageCache settings path won't be replaced.

havran’s picture

In Imagecache 2.0 is path for ImageCache settings admin/build/imagecache. For this reason i use condition which set correct path in '!presets' => array(...). This is work in my installation correctly and i get ImageCache settings page. I testing this only with ImageCache 2.0.

Here is bit moddified patch.

havran’s picture

Status: Needs work » Needs review
StatusFileSize
new2.1 KB

Here :).

sun’s picture

oww... now I get it! You've turned $imagecache_path into an array already:

$imagecache_path = array('!presets' => url('admin/settings/imagecache'));

Please don't do that. t() and the arguments to t() belong together. It's okay to prepare $imagecache_path somewhere else, but the overall structure should look like:

$imagecache_path = url('admin/settings/imagecache');
[...]
t('...', array('!presets' => $imagecache_path);

So if the string in t() will ever be updated, one will find the contained argument right next to it.

havran’s picture

StatusFileSize
new2.08 KB

Thanks to review, here is (i hope) final patch.

JamieR’s picture

Patch applied and is working for me thus far... Thanks havran!

sun’s picture

Status: Needs review » Needs work

Hm. Patch does not apply against DRUPAL--5, resp. latest development snapshot. Could you re-roll, please?

havran’s picture

Status: Needs work » Needs review
StatusFileSize
new2.18 KB

Here is same patch against DRUPAL-5.

sun’s picture

StatusFileSize
new2.26 KB

Hrm... much duplicate code. What about attached patch?

micahw156’s picture

Patch #12 worked for me in a couple of different environments:

  • Drupal 5.7, ImageCache 5.x-1.6, Thickbox 5.x-1.2
  • Drupal 5.7, ImageAPI 5.x-1.2, ImageCache 5.x-2.1, Thickbox 5.x-2.0

Patch applied to latest (2008-Jun-15) 5.x-1.x-dev.

You may note from this that it did not break ImageCache 5.x-1.x compatibility.

Micah

sun’s picture

Status: Needs review » Reviewed & tested by the community
sun’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD, 5.x-2.x, and 5.x-1.x.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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