powermail icon indicating copy to clipboard operation
powermail copied to clipboard

[BUG] Serialization of 'Closure' not allowed on accepting Opt-In (no captcha)

Open vk-chaertl opened this issue 3 years ago • 10 comments

Hello there,

We're getting the following error in typo3_src/10.4.26/typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php line 291 upon accepting a Double-Opt In-Link, but only sometimes:

Exception: Serialization of 'Closure' is not allowed.

For your convenience, here's the affected function:

    protected function renderHiddenReferrerFields()
    {
        /** @var RequestInterface $request */
        $request = $this->renderingContext->getControllerContext()->getRequest();
        $extensionName = $request->getControllerExtensionName();
        $controllerName = $request->getControllerName();
        $actionName = $request->getControllerActionName();
        $actionRequest = [
            '@extension' => $extensionName,
            '@controller' => $controllerName,
            '@action' => $actionName,
        ];

        $result = LF;
        $result .= '<input type="hidden" name="' . htmlspecialchars($this->prefixFieldName('__referrer[@extension]')) . '" value="' . htmlspecialchars($extensionName) . '" />' . LF;
        $result .= '<input type="hidden" name="' . htmlspecialchars($this->prefixFieldName('__referrer[@controller]')) . '" value="' . htmlspecialchars($controllerName) . '" />' . LF;
        $result .= '<input type="hidden" name="' . htmlspecialchars($this->prefixFieldName('__referrer[@action]')) . '" value="' . htmlspecialchars($actionName) . '" />' . LF;
/* Troublesome line next*/
        $result .= '<input type="hidden" name="' . htmlspecialchars($this->prefixFieldName('__referrer[arguments]')) . '" value="' . htmlspecialchars($this->hashService->appendHmac(base64_encode(serialize($request->getArguments())))) . '" />' . LF;
        $result .= '<input type="hidden" name="' . htmlspecialchars($this->prefixFieldName('__referrer[@request]')) . '" value="' . htmlspecialchars($this->hashService->appendHmac(json_encode($actionRequest))) . '" />' . LF;

        return $result;
    }

We're using some custom JQuery, Powermail Conditions, and NO Captcha.

Sadly, I am by no means proficient in PHP, so I figured I'd ask you guys if you know what's causing the problem before doing anything.

If you think this problem has nothing to do whatsoever with Powermail, feel free to close of course.

Thanks for your help!

vk-chaertl avatar Apr 08 '22 06:04 vk-chaertl

same here in two different projects

mhirdes avatar May 24 '22 12:05 mhirdes

Also having this issue after upgrading a project from 10.4 to 11.5.

Mbigha avatar Aug 25 '22 10:08 Mbigha

Having the same problem with TYPO3 10.4 and Powermail 8.4.1.

lapierrec avatar Sep 14 '22 13:09 lapierrec

Same here, where we could narrow it down to forms with double-optin and unique like

plugin.tx_powermail.settings.setup.validation {
   unique {
       # Enable unique check for {email} - every email must be unique on the page where mails are stored
       email = 1
   }
}

enabled.

Gregor-Agnes avatar Sep 21 '22 06:09 Gregor-Agnes

Hello,

we have the same problem, with TYPO3 11.5.16 Powermail 10.4.3, Powermail Conditions 9.0.3 and we are using the Double-Opt-In feature.

Has anyone tested switching between different Mailer-Methods? We're on sendmail as in almost all of our TYPO3-Installations. I am thinking about trying out SMTP as method. But if someone already tried this, i'd be happy if you could share!

Thanks in advance

Sebastian

sebomoto avatar Sep 29 '22 07:09 sebomoto

Same here, double opt-in, sendmail, powermail_conditions and email validation.

mtness avatar Nov 17 '22 15:11 mtness

Try this in your Setup:

[request.getQueryParams()['tx_powermail_pi1'] && request.getQueryParams()['tx_powermail_pi1']['action'] == 'optinConfirm']
    plugin.tx_powermail.settings.setup.spamshield {
        _enable = 0
        methods.10._enable = 0
    }
[end]

from: https://github.com/einpraegsam/powermail/issues/376#issuecomment-831040333

plojewski avatar Nov 23 '22 10:11 plojewski

same setup, same problem ... unfortunately none of the mentioned workarounds work. does anyone has further ideas?

mlandermann avatar Mar 30 '23 07:03 mlandermann

@einpraegsam Hi Alex, i run in same issue but only if input field as a type of "password" is configured and the option "double optin" is activated. After clicking the confirmation link from the email, this error is thrown. At this point in time, the "password_mirrored" object no longer exists or the value is empty. In the PasswordValidator.php on line 37 would want to return an error message to this form. Only this session no longer exists and this error occurs. In my opinion is a revalidation not needed at this point.

Best regards David

Powermail: 8.4.2 /powermail/Classes/Domain/Validator/PasswordValidator.php

$this->setErrorAndMessage($answer->getField(), 'password');

davidk1982 avatar Jul 05 '23 15:07 davidk1982

how to reproduce

  • add a mandatory field A
  • make this field depending on on other field B (say show A on option C)
  • choose C in B (A ist not displayed)
  • Activate "Double Opt-In" for the form
  • Go to FE and Sumit the Form
  • Open Optin-Link in other Browser, or clear your cookies leads to validate field A as required (when confirmOptinAction forwards to createAction) (because Values of Session are missing)
  • same occures with current Versions powermail 12.3.1 powermail_cond 11.2.2 and TYPO3 12.4.15 (but other error in FE)

achimfritz avatar May 22 '24 05:05 achimfritz