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

unable to load powermail form #30

Open
marcovonarx opened this issue Oct 25, 2018 · 1 comment
Open

unable to load powermail form #30

marcovonarx opened this issue Oct 25, 2018 · 1 comment

Comments

@marcovonarx
Copy link

we use version 3.5.2, but it looks this may happen on 6.1 as well.
in some rare cases powermail_cond is not able to fetch a form object and generates an exception

Uncaught TYPO3 Exception: Argument 1 passed to In2code\PowermailCond\Controller\ConditionController::setTextFields() must be an instance of In2code\Powermail\Domain\Model\Form, null given, called in /typo3conf/ext/powermail_cond/Classes/Controller/ConditionController.php on line 60 | TypeError thrown in file /typo3conf/ext/powermail_cond/Classes/Controller/ConditionController.php in line 77.
Requested URL: ...../online-antrag/?type=3132

one work around could be (in version 3.5.2)
In2code\PowermailCond\Controller\ConditionController starting at line 59

        $form = $formRepository->findByIdentifier($this->powermailArguments['mail']['form']);
        $this->setTextFields($form);

to

        $form = $formRepository->findByIdentifier($this->powermailArguments['mail']['form']);
        if (is_null($form)) return null;
        $this->setTextFields($form);
@Mainbird
Copy link

Mainbird commented Jul 8, 2021

Hi :)

I have noticed the same issue with version 8.1.0, but the buildConditionAction is currently returning a string

https://github.com/einpraegsam/powermail_cond/blob/develop/Classes/Controller/ConditionController.php#L55

So I think something like this:

/** @var Form $form */
$form = $formRepository->findByIdentifier($this->powermailArguments['mail']['form']);

if ($form === null) {
    return json_encode([]):
}

should also be fine, but I don't know if we should send some error data or something else to the frontend so that we can handle/ ignore the error.

What do you think? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants