diff --git a/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php index 873568d1e13b3b18151dfd88f3222bfc7e940c9b..abb6160dffd71612230183c602d8968ca9ebdea7 100644 --- a/core/modules/image/src/Entity/ImageStyle.php +++ b/core/modules/image/src/Entity/ImageStyle.php @@ -298,10 +298,12 @@ public function flush($path = NULL) { $module_handler = \Drupal::moduleHandler(); $module_handler->invokeAll('image_style_flush', [$this, $path]); - // Clear caches so that formatters may be added for this style. - \Drupal::service('theme.registry')->reset(); - - Cache::invalidateTags($this->getCacheTagsToInvalidate()); + // Clear caches when the complete image style is flushed, + // so that field formatters may be added for this style. + if (!isset($path)) { + \Drupal::service('theme.registry')->reset(); + Cache::invalidateTags($this->getCacheTagsToInvalidate()); + } return $this; }