in2code-de / powermailrecaptcha

Google recaptcha for powermail 3
10 stars 13 forks source link

Needs change for latest powermail 12.3.5 using checkCreate action instead of create #30

Closed sypets closed 2 months ago

sypets commented 2 months ago

Please check if changes necessary for latest powermail (e.g. 12.3.5 or master/main)

More information here: https://github.com/in2code-de/powermail/issues/1101

Specifically, I think this change is necessasry:

protected function isCaptchaCheckToSkip(): bool
    {
        if (property_exists($this, 'flexForm')) {
            $confirmationActive = $this->flexForm['settings']['flexform']['main']['confirmation'] === '1';
-            return $this->getActionName() === 'create' && $confirmationActive;
+           $action = $this->getActionName();
+            return ($action === 'create' || $action === 'checkCreate') && $confirmationActive;
        }
        return false;
    }

https://github.com/thomasrawiel/powermailcaptcha/blob/develop/Classes/Domain/Validator/SpamShield/CaptchaMethod.php#L187