diff --git a/core/modules/image/image.module b/core/modules/image/image.module index 0ba5691b08..84078ae7f0 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -195,10 +195,10 @@ function image_file_predelete(FileInterface $file) { */ function image_path_flush($path) { \Drupal::service('event_dispatcher')->dispatch( - ImageStyleEvents::FLUSH_FROM_SOURCE_IMAGE_URI, new ImageStyleEvent(NULL, [ 'sourceImageUri' => $path, - ]) + ]), + ImageStyleEvents::FLUSH_FROM_SOURCE_IMAGE_URI ); } diff --git a/core/modules/image/src/Entity/ImageStyle.php b/core/modules/image/src/Entity/ImageStyle.php index bdf8f805e0..3d8604a32c 100644 --- a/core/modules/image/src/Entity/ImageStyle.php +++ b/core/modules/image/src/Entity/ImageStyle.php @@ -199,7 +199,7 @@ public function flush($path = NULL) { ->dispatch(ImageDerivativePipelineEvents::REMOVE_DERIVATIVE_IMAGE); } else { - \Drupal::service('event_dispatcher')->dispatch(ImageStyleEvents::FLUSH, new ImageStyleEvent($this)); + \Drupal::service('event_dispatcher')->dispatch(new ImageStyleEvent($this), ImageStyleEvents::FLUSH); } return $this; } diff --git a/core/modules/image/src/Plugin/ImageProcessPipeline/ImageProcessPipelineBase.php b/core/modules/image/src/Plugin/ImageProcessPipeline/ImageProcessPipelineBase.php index 3a3ddd7f83..10d686d2d5 100644 --- a/core/modules/image/src/Plugin/ImageProcessPipeline/ImageProcessPipelineBase.php +++ b/core/modules/image/src/Plugin/ImageProcessPipeline/ImageProcessPipelineBase.php @@ -127,7 +127,7 @@ public function hasImage(): bool { */ public function dispatch(string $event, array $arguments = []): ImageProcessPipelineInterface { try { - $this->eventDispatcher->dispatch($event, new ImageProcessEvent($this, $arguments)); + $this->eventDispatcher->dispatch(new ImageProcessEvent($this, $arguments), $event); } catch (ImageProcessException $e) { throw new ImageProcessException("Failure processing '$event': " . $e->getMessage(), $e->getCode(), $e);