When you create a new image style, it makes it possible for you to select a new formatter for your image fields. However, when selecting this new formatter, it doesn't output the image at all when viewing the node. This is because in image_theme(), we run through all the existing styles to create new formatters. However if the theme registry is not rebuilt, then when the formatter is selected no output is returned.
This patch rebuilds the theme registry when creating/editing/deleting an image style.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | image_rebuild_theme.patch | 689 bytes | quicksketch |
| #1 | image_rebuild_theme.patch | 653 bytes | quicksketch |
| image_rebuild_theme.patch | 12.33 KB | quicksketch |
Comments
Comment #1
quicksketchOops, that patch had a ton of other unrelated changes. Here we are.
Comment #2
WorldFallz commentedPatch applies cleanly and fixes the problem!
Comment #3
grendzy commentedhmm, patch didn't work for me. These are the steps I followed (clean HEAD with just this patch):
- Add image field to Article type.
- Create new image style called "sideways" with 90° rotation.
- Go to "display fields" for article; "sideways" formatter isn't available.
If I manually clear the caches on /admin/config/development/performance, then it shows up.
BTW - Does this issue mean we don't have test coverage for adding an imagefield? Or does simpletest somehow clear the theme registry as a side-effect?
Comment #4
WorldFallz commentedIt's possible I manually cleared the caches as well-- i think I do that on autopilot, lol. I just tried it again, careful not to clear the cache and can confirm gendzy's results.
Comment #5
quicksketchHere we go, rebuilding the theme registry was not enough, since Field was caching the list of formatters. Now we clear both the formatter cache and then rebuild the theme registry. Much better.
Comment #6
quicksketchTitle didn't make any sense. ;-)
Comment #7
moshe weitzman commentedtoo many pesky caches :(
Comment #8
dries commentedCommitted to CVS HEAD. Thanks.