[Neos] Typo3.Form Neos Question

nikos nick at jamalade.com
Tue May 20 23:30:45 CEST 2014


Hi all

I am using Typo3.Form in my Neos based website and I am wondering what is the best way to display a link back to display the form again in the event 
of an error that may occur in a finisher. The use case I am thinking of is when I am using an EmailFinisher and there is an error e.g. can't connect 
to the smtp email server. I would like to present a message informing the website visitor that there was a problem and that they may wish to resend 
the form providing them with a link to the page with the form.

At the moment I have provided my own EmailFinisher and I am able to respond with a message but no link. I have implement this by catching the 
exception raised from the Swiftmail send in my EmailFinisher executeInternal method, setting the response and cancelling further finishers with this 
snipet:

   try {
      $mail->send();
   } catch (\Exception $exception) {
     // throw new \TYPO3\Form\Exception\FinisherException('Unable to send email', 1327060223, $exception);
     // email failed to send for some reason so rather than spew over fe show an on error message and stop other finishers

     $response = $formRuntime->getResponse();
     $response->setContent($this->parseOption('onErrorMessage'));
     $this->finisherContext->cancel();
   }

But I am unsure how to get a link (uri) to the originating page.

Hope someone is able to help.

Many thanks

Nikos


More information about the Neos mailing list