The imageCache theme functions are done based on the Preset name and not preset id, so if the preset name is renamed (Ie the designer comes back and says the image width should be so and so instead of so and so and one is trying to keep the image preset name corresponding to the widths ... ) any where the formattor has been set loses it's settings.

I'm not sure how'd that'd be changed. Any change would be a ugly upgrade path. It'd be horrible to try and capture everywhere the theme has been set, and especially views (ie. exported views).

And using the preset ID would make for ugly formatter names, less user friendly.

Comments

kmonty’s picture

Version: 6.x-2.0-beta9 » 6.x-2.x-dev

Is this actually an issue? I have not tested it yet but someone brought up a similar issue with the Node Gallery module: #611734: Changing the name of the imagecache preset name breaks node_gallery

hefox’s picture

Somewhat, but at the end of the writting the issue I think I basically realized it'd be quite hard to fix. My guess is preset name really shouldn't be editable due to this.

kmonty’s picture

Yeah, I am reluctant to fix this issue with Node Gallery for the same reason.

andypost’s picture

I think that imagecache require same notification about changes as D7 has.

As D6 style it could be like

module_invoke_all('imagecache_preset', $op, $preset);
module_invoke_all('imagecache_action', $op, $action);

EDIT So other modules can hook this changes and reflect them properly

powery’s picture

Category: feature » bug

How to fix this issue?

andypost’s picture

Also a good idea to give Label for preset #606598: Human readable image-style names

powery’s picture

And for 6.x version?

hefox’s picture

I think there's not really a way to fix it per say that wouldn't end up having other issues. (For example, exported features/etc.). IMO if anything, just make it harder/discourage editing of preset name.

andypost’s picture

@hefox I think it's not too hard to add Label for preset, when no label is present so preset-name could operate as Label.

Also I still sure that it's easy to implement hooks from #4 or use drupal_alter to allow other modules to be notified about changes. Mostly a preset needs this.

ergophobe’s picture

Why can't image presets have a machine-readable name and human-readable name, like CCK fields?

I mean, the upgrade path could be that on upgrade, the human-readable name is simply set to the machine-readable name. Having the human readable name makes an extra value available to themers and module developers who can use it or not as they see fit. Those that do use it, would require users to upgrade to a version of imagecache that has human-readable names.

That's more or less the approach of the "Human Readable Imagecache presets" patch mentioned above. I haven't tried it yet, but I looked through the code and it looks pretty good.

drewish’s picture

Category: bug » feature
fizk’s picture

Marking as ImageCache 3.x Todo.

fizk’s picture

Issue tags: +ImageCache 3

Incorrect tag.