diff --git a/src/Plugin/ImageEffect/AutomatedCropEffect.php b/src/Plugin/ImageEffect/AutomatedCropEffect.php index 84c244a..e3ed456 100644 --- a/src/Plugin/ImageEffect/AutomatedCropEffect.php +++ b/src/Plugin/ImageEffect/AutomatedCropEffect.php @@ -223,7 +223,7 @@ class AutomatedCropEffect extends ConfigurableImageEffectBase implements Contain /** @var \Drupal\crop\Entity\CropType $crop_type */ $crop_type = $this->typeStorage->load($this->configuration['crop_type']); $automatic_crop_event = new AutomaticCrop($image, $crop_type, $this->configuration); - $this->eventDispatcher->dispatch(Events::AUTOMATIC_CROP, $automatic_crop_event); + $this->eventDispatcher->dispatch($automatic_crop_event, Events::AUTOMATIC_CROP); $this->crop = $automatic_crop_event->getCrop(); } @@ -265,7 +265,7 @@ class AutomatedCropEffect extends ConfigurableImageEffectBase implements Contain */ public function getAutomaticCropProvidersList() { $event = new AutomaticCropProviders(); - $this->eventDispatcher->dispatch(Events::AUTOMATIC_CROP_PROVIDERS, $event); + $this->eventDispatcher->dispatch($event, Events::AUTOMATIC_CROP_PROVIDERS); return $event->getProviders(); }