Hi all,

I have a
" symfony [err] {sfForwardException} Too many forwards have been
detected for this request (> 5)"
in my log, I know what it is but I don't know why I get it.

The code is for a batch file sending newsletter.
There is a part of the batch file


foreach ($array_emails as $email)
      {
        try{
              $action->executeSendNewsletterFromBatch($email, $batch-
>getNewsletterId());  //call
            }catch(sfException $e){
              $message = 'exception for email ['.htmlspecialchars
($email, ENT_NOQUOTES).']';
              $logger->log($message, SF_LOG_NOTICE);
              $hasError=true;
            }
      }

Here is the action called :

public function executeSendNewsletterFromBatch($email, $newsletterId)
  {
      if ($newsletterId == '' || $newsletterId == null)
      { $logger->log("No id for newsletter", 'notice');  }
      else
      {
          $this->getContext()->getUser()->setAttribute
('id_for_newsletter', $newsletterId);
          $this->getContext()->getUser()->setAttribute
('email_for_newsletter', $email);

        $validator = new sfEmailValidator();
        $validator->initialize($this->getContext()); // here you could
use array(param => value) as second parameter, see sfEmailValidator
class for more info

        //$message2 = 'email OK (email : ['.$adr.'])';
        if (!$validator->execute($email, $erreur))
        {
          //bad email : log error
          $message = 'email for newsletter invalid trying to send
newsletter number '.$newsletterId.' (email : ['.htmlspecialchars
($email, ENT_NOQUOTES).'])';
          $this->logMessage($message, 'notice');
        }
        else
        {
           $this->raw_email = $this->sendEmail('mail',
'sendNewsletter');
        }
      }

  }

The sendNewsletter action is another action with no exotic part.

Can someone see the path of all forward and tell me what I made wrong
and why ?
Thx all,
Stéphane
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to