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.

Comments

quicksketch’s picture

StatusFileSize
new653 bytes

Oops, that patch had a ton of other unrelated changes. Here we are.

WorldFallz’s picture

Patch applies cleanly and fixes the problem!

grendzy’s picture

hmm, 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?

WorldFallz’s picture

It'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.

quicksketch’s picture

StatusFileSize
new689 bytes

Here 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.

quicksketch’s picture

Title: New image styles are not usable as style » New image styles are not usable as formatters

Title didn't make any sense. ;-)

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

too many pesky caches :(

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

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