i needed imagecache support for imce so i went ahead and modified the code of this module to support it.

im currently doing my first drupal project and this is the first time i looked inside a drupal module. so the modified code might not work in all environments & configurations. use at own risk.

the modification works fully on both my local and production servers and i can now choose all types of imagecache presets (image linked to node, image linked to image, etc).

thanks go out to "obrigado" http://drupal.org/node/359098 for pointing me in the right direction with regards to imagecache integration.

also fixed the edit bug when field is empty http://drupal.org/node/413844

im attaching the modified module file here so the author can integrate the modifications into the next release. sorry dont know how to make patch files.

CommentFileSizeAuthor
#9 imceimage.module.patch710 bytesagerson
imceimage.module.txt17.32 KBdj-nitehawk

Comments

yang_yi_cn’s picture

#359098: Patch for Basic ImageCache Integration is marked as a duplication of this.

yang_yi_cn’s picture

Status: Needs work » Fixed

Thanks, With a little modification, I commited it to CVS.

obrigado’s picture

Thanks to dj-nitehawk and yang_yi_cn for making this happen!

dj-nitehawk’s picture

awesome!!! cheers guys... now i can get future updates...

love the drupal community...

Status: Fixed » Closed (fixed)

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

happyloman’s picture

Title: full imagecache support added » Image cache does not work when drupal is installed in subdirectory
Category: task » bug
Priority: Normal » Critical
Status: Closed (fixed) » Active

This update does not work when drupal is installed in a subdirectory. The path for the image cache image is output like:
http://www.mysite.com/drupal/sites/default/files/imagecache/200x160//dru...

The extra /drupal/ breaks the link to the image.

obrigado’s picture

I just ran into this the other day... quick and kludgey fix:

Add this around line 365 of imceimage.module

$item['imceimage_path'] = str_replace(base_path(), '', $item['imceimage_path']);

Not a long term fix (it only works if you're in a subdirectory...)

Btw I think this should have been its own issue... it's confusing to revise the titles of existing issues.

agerson’s picture

I am experiencing the same issue. #7 did fix the problem.

agerson’s picture

StatusFileSize
new710 bytes

I have created a patch. Don't use it, will break non root installs. See below.

obrigado’s picture

Status: Active » Needs review

Thanks agerson — but careful with the patch, since it breaks Image Cache support for Drupal installs that are not in subdirectories. Needs a conditional or something.

agerson’s picture

I don't have a root level drupal install to test this with, but what do you think of:

<?php
  if (base_path() != "/") {
    $item['imceimage_path'] = str_replace(base_path(), '', $item['imceimage_path']);
  }
?>