diff --git a/core/modules/image/image.install b/core/modules/image/image.install index 11573b9..fd14d03 100644 --- a/core/modules/image/image.install +++ b/core/modules/image/image.install @@ -5,8 +5,6 @@ * Install, update and uninstall functions for the image module. */ -use Drupal\image\Entity\ImageStyle; - /** * Implements hook_install(). */ @@ -63,32 +61,3 @@ function image_requirements($phase) { return $requirements; } - -/** - * @addtogroup updates-8.3.0 - * @{ - */ - -/** - * Add 'upscale' parameters to 'Scale and crop' effects. - */ -function image_update_8301() { - foreach (ImageStyle::loadMultiple() as $image_style) { - $edited = FALSE; - foreach ($image_style->getEffects() as $effect) { - if ($effect->getPluginId() === 'image_scale_and_crop') { - $configuration = $effect->getConfiguration(); - $configuration['data']['upscale'] = FALSE; - $effect->setConfiguration($configuration); - $edited = TRUE; - } - } - if ($edited) { - $image_style->save(); - } - } -} - -/** - * @} End of "addtogroup updates-8.3.0". - */ diff --git a/core/modules/image/image.post_update.php b/core/modules/image/image.post_update.php index 04d8c4b..316d511 100644 --- a/core/modules/image/image.post_update.php +++ b/core/modules/image/image.post_update.php @@ -7,6 +7,7 @@ use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\Core\Entity\Entity\EntityFormDisplay; +use Drupal\image\Entity\ImageStyle; /** * Saves the image style dependencies into form and view display entities. @@ -20,3 +21,32 @@ function image_post_update_image_style_dependencies() { $display->save(); } } + +/** + * @addtogroup updates-8.3.0 + * @{ + */ + +/** + * Add 'upscale' parameter to 'Scale and crop' effects. + */ +function image_post_update_scale_and_crop_effect_upscale() { + foreach (ImageStyle::loadMultiple() as $image_style) { + $edited = FALSE; + foreach ($image_style->getEffects() as $effect) { + if ($effect->getPluginId() === 'image_scale_and_crop') { + $configuration = $effect->getConfiguration(); + $configuration['data']['upscale'] = FALSE; + $effect->setConfiguration($configuration); + $edited = TRUE; + } + } + if ($edited) { + $image_style->save(); + } + } +} + +/** + * @} End of "addtogroup updates-8.3.0". + */