I'm thinking that while the theme registry is being built we can capture the original values that are being overridden and use those instead of hardcoding a call to the imagecache theme functions. Shouldn't be too hard to do but at the moment I don't know of any modules that conflict in this way so it isn't urgent.

Comments

thedavidmeister’s picture

Status: Active » Needs work

I've pushed a fix to the 6.x-1.x branch but it needs to be ported to 7.x-1.x as the registry_alter logic has been almost completely rewritten.

thedavidmeister’s picture

The workaround uses a backtrace to see what arguments were given to the theme function that invoked ICD so that they can be compared to what's in the theme registry. Couldn't see any other way to reliably and simultaneously get information about both the callback function that was registered before ICD added its entries and the theme hook that is currently being invoked.

This means that we can accomodate other modules that mess with the theme registry directly, provided that ICD has the highest weight out of these modules.

It also means that, by design, if theme_imagecache_defaults is called by any means other than by theme() it will return an empty string.

Before this gets marked as fixed:

- Document the above
- Port to 7
- Make sure ICD has a really high weight
- Try really hard to break this implementation with hooks in other modules and confirm that it really avoids potential conflicts the way that I want

thedavidmeister’s picture

Version: » 7.x-1.x-dev

fixed in 7.x-1.x branch.

Still needs documentation, high module weight and tests.

Will probably roll a beta2 for both 6.x and 7.x branches once this is polished a little more.

thedavidmeister’s picture

Great, found another contrib module that modifies the theme registry around imagecache :)

http://drupal.org/project/imageinfo_cache

thedavidmeister’s picture

Think I have a working fix in place for this in 6.x-1.x without needing to rely on module weight which would be a bit of a hack. Will be rolling a beta-2 for that now :)

thedavidmeister’s picture

Status: Needs work » Fixed

Fix is in 7.x-1.x

Status: Fixed » Closed (fixed)

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