in2code-de / powermail_cond

Add conditions (via AJAX) to TYPO3 powermail forms for fields and pages
8 stars 23 forks source link

Powermail opt-in confirmation breaks for cross browser functionality #51

Open Mainbird opened 3 years ago

Mainbird commented 3 years ago

Hi @einpraegsam,

we got some struggle with cross browser functionality and opt-in confirmation because sometimes $arguments were null inside ConditionAwareValidator.

We could reproduce this with the following setup:

  1. Create a form with some mandatory fields
  2. Create a condition to make one of these mandatory fields optional
  3. Submit the form (e.g. with Chrome)
  4. Confirm the opt-in email with another browser (e.g. with Firefox), maybe private mode will work as well here

After clicking the confirmation link the error message:

Validation failed while trying to call In2code\Powermail\Controller\FormController->createAction()

will be triggered, because $arguments were null and the validator will complain about a mandatory field that is not set because the powermail_cond-Session is missing. To fix this issue we have added the following condition to ConditionAwareValidator:

if ($arguments === null) {
    return;
}

What do you think about it?

zabinetta commented 3 years ago

We have the same problem. Firefox working, Chrome not. the odd thing is: after the mail is confirmed, it's unhidden in Backend, but no further Mails are sent, so my receivers long time were not really aware of the problem, they just wondered why they got less emails..