Closed (fixed)
Project:
Styles
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Feb 2011 at 23:45 UTC
Updated:
15 Jun 2011 at 09:41 UTC
Jump to comment: Most recent file
In Styles 1.x, you had this code:
function file_styles_styles_presets() {
...
foreach (image_styles() as $style_name => $style) {
$presets['file'][$style_name]['image'] = array($style_name);
}
...
}
In Styles 2.x, no such code exists in file_styles_styles_default_presets().
So in 1.x, when I added an image style "foo" via admin/config/media/image-styles/add, and then went to admin/config/media/types/manage/image/display, "File Style: foo" would be a format option for the file field. But in 2.x, it isn't.
This also means that if I upgrade a site from 1.x to 2.x that was using "File Style: foo", then it gets reverted to "Generic File" instead.
Was this an intentional change?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | file-styles-support-media-file-image-1058056-7.patch | 3.91 KB | aaron |
Comments
Comment #1
effulgentsia commentedAt DrupalCon, Aaron said this was not an intentional change. I'll work on a patch.
Comment #2
oxyc commentedSeems like he abstracted this into effects. Currently that line of code exists in
file_styles.effects.inc.file_styles.admin.incalso has some code (commented out) for displaying effects in vertical tabs. I tried working on it but gave up for now.Although, a proper patch for making image styles available, even if temporarily, would be much appreciated on my side at least. I've made a few attempts at revealing them as presets but they are all ugly hacks.
Comment #3
neurojavi commentedsubscribing
Comment #4
ybabel commentedsuscribing too
Comment #5
aaron commentedfixed; commit at http://drupalcode.org/project/styles.git/commit/803247c
Comment #6
aaron commentedand at http://drupalcode.org/project/styles.git/commit/2c15e41 oops...
Comment #7
aaron commentedalso committed this patch, which adds media styles as formatters.
Comment #8
aaron commentedoops, rather http://drupalcode.org/project/styles.git/commitdiff/fe77559?hp=d3c514acf... and http://drupalcode.org/project/styles.git/commitdiff/3cc6b9f?hp=fe775598d... (forgot to increment the update).
Comment #9
nyl_auster commentedIt works :)
I tried the latest version on the Git repository and It seems to me that problems are gone. Like Effulgentsia I could not use image presets defined in admin/config/media/image-styles on files styles.
With this update, now, I can.
Thx