From c82c24d5c037d901edbebccf62ee91c528d79c4c Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 27 Sep 2024 11:14:11 -0700 Subject: [PATCH] Speculative fix for BUGS-8929; guard against situations where Drupal\image\Entity\ImageStyle might not exist. --- pantheon_advanced_page_cache.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pantheon_advanced_page_cache.module b/pantheon_advanced_page_cache.module index ad7b219..aaf7300 100644 --- a/pantheon_advanced_page_cache.module +++ b/pantheon_advanced_page_cache.module @@ -19,7 +19,7 @@ function pantheon_advanced_page_cache_file_update(EntityInterface $file) { // If this is an image, we need to clear the edge cache paths for every // image style, or those won't work. - if (strpos($file->getMimeType(), 'image', 0) === 0) { + if ((class_exists(ImageStyle)) && (strpos($file->getMimeType(), 'image', 0) === 0)) { $styles = ImageStyle::loadMultiple(); foreach ($styles as $style) { $file_uri = $file->getFileUri();