KonstantinCodes / mautic-recaptcha

This Plugin brings reCAPTCHA integration to mautic.
GNU General Public License v3.0
50 stars 29 forks source link

Does not work with soon to be released Mautic V5: ($translator) must be of type Symfony\Component\Translation\TranslatorInterface #45

Open adiux opened 1 year ago

adiux commented 1 year ago

Error

[2023-02-22 17:28:56] mautic.CRITICAL: Uncaught PHP Exception TypeError: "MauticPlugin\MauticRecaptchaBundle\EventListener\FormSubscriber::__construct(): Argument #5 ($translator) must be of type Symfony\Component\Translation\TranslatorInterface, Mautic\CoreBundle\Translation\Translator given, called in /var/www/html/var/cache/dev/ContainerEfSedQs/getMautic_Recaptcha_EventListener_FormSubscriberService.php on line 9" at /var/www/html/plugins/MauticRecaptchaBundle/EventListener/FormSubscriber.php line 80 {"exception":"[object] (TypeError(code: 0): MauticPlugin\\MauticRecaptchaBundle\\EventListener\\FormSubscriber::__construct(): Argument #5 ($translator) must be of type Symfony\\Component\\Translation\\TranslatorInterface, Mautic\\CoreBundle\\Translation\\Translator given, called in /var/www/html/var/cache/dev/ContainerEfSedQs/getMautic_Recaptcha_EventListener_FormSubscriberService.php on line 9 at /var/www/html/plugins/MauticRecaptchaBundle/EventListener/FormSubscriber.php:80)
TomJ1588 commented 4 months ago

Swap out use Symfony\Component\Translation\TranslatorInterface with use Mautic\CoreBundle\Translation\Translator;

Then change the following: ` /**

Changing TranslatorInterface to be Translator