Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vk-chaertl opened this issue Apr 8, 2022 · 10 comments
Assignees
Labels

Comments

@vk-chaertl
Copy link

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!

@mhirdes
Copy link
Contributor

mhirdes commented May 24, 2022

same here in two different projects

@Mbigha
Copy link

Mbigha commented Aug 25, 2022

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

@lapierrec
Copy link

Having the same problem with TYPO3 10.4 and Powermail 8.4.1.

@Gregor-Agnes
Copy link

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.

@sebomoto
Copy link

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

@mtness
Copy link

mtness commented Nov 17, 2022

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

@plojewski
Copy link

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: #376 (comment)

@mlandermann
Copy link

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

@davidk1982
Copy link

@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');

@achimfritz
Copy link

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)

@mschwemer mschwemer added the bug label Aug 9, 2024
@mschwemer mschwemer self-assigned this Aug 9, 2024
@mschwemer mschwemer changed the title Serialization of 'Closure' not allowed on accepting Opt-In (no captcha) [BUG] Serialization of 'Closure' not allowed on accepting Opt-In (no captcha) Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests