diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-08-09 19:55:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-08-09 19:55:57 +0000 |
commit | 619c35992e6356f0886854d1edaba2d5c97c20dc (patch) | |
tree | 24804d2994d525b681670fee3725110e752d6094 /modules/image/image.module | |
parent | 0777093053972f73f7cb3f1ca9badb9b45b49fe9 (diff) | |
download | brdo-619c35992e6356f0886854d1edaba2d5c97c20dc.tar.gz brdo-619c35992e6356f0886854d1edaba2d5c97c20dc.tar.bz2 |
- Patch #812688 by andypost, Damien Tournoud: organize image formatters around settings.
Diffstat (limited to 'modules/image/image.module')
-rw-r--r-- | modules/image/image.module | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/image/image.module b/modules/image/image.module index 05e19bde9..8c40fbaa9 100644 --- a/modules/image/image.module +++ b/modules/image/image.module @@ -365,14 +365,11 @@ function image_image_style_save($style) { $instance_changed = FALSE; foreach ($instance['display'] as $view_mode => $display) { // Check if the formatter involves an image style. - $matches = array(); - if (preg_match('/__([a-z0-9_]+)/', $display['type'], $matches)) { + if ($display['type'] == 'image' && $display['settings']['image_style'] == $style['old_name']) { // Update display information for any instance using the image // style that was just deleted. - if ($style['old_name'] == $matches[1]) { - $instance['display'][$view_mode]['type'] = str_replace($style['old_name'], $style['name'], $display['type']); - $instance_changed = TRUE; - } + $instance['display'][$view_mode]['settings']['image_style'] = $style['name']; + $instance_changed = TRUE; } } if ($instance['widget']['settings']['preview_image_style'] == $style['old_name']) { |