Closed (fixed)
Project:
ImageCache Defaults
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2012 at 04:26 UTC
Updated:
24 Jan 2013 at 13:10 UTC
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
Comment #1
thedavidmeister commentedI'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.
Comment #2
thedavidmeister commentedThe 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
Comment #3
thedavidmeister commentedfixed 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.
Comment #4
thedavidmeister commentedGreat, found another contrib module that modifies the theme registry around imagecache :)
http://drupal.org/project/imageinfo_cache
Comment #5
thedavidmeister commentedThink 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 :)
Comment #6
thedavidmeister commentedFix is in 7.x-1.x