summaryrefslogtreecommitdiff
path: root/modules/image/image.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/image/image.module')
-rw-r--r--modules/image/image.module9
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']) {