Re: Running the action twice?

2009-12-11 Thread Dr. Loboto
If you see HTTP requests duplication it means actual redirect, not
requestAction or something similar. And if you use there some third
party code it may do this redirect.

Waiting for more news.

On Dec 12, 5:13 am, bujanga  wrote:
> This is a bit of a flaky one. Think it is mainly a problem with the
> third-party application I am working with. I worked around it the
> other day.
>
> I have, however; seen a few duplicate HTTP requests from some very
> simple actions and views. These are NOT generated by any by a
> requestAction. My beforeFilter does have some Session calls and a
> ClassRegistry::init, along with settings for the Security and Auth
> components. If I figure things out better than this, I will update
> this thread.
>
> Thanks.
>
> Gary

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Running the action twice?

2009-12-11 Thread bujanga
This is a bit of a flaky one. Think it is mainly a problem with the
third-party application I am working with. I worked around it the
other day.

I have, however; seen a few duplicate HTTP requests from some very
simple actions and views. These are NOT generated by any by a
requestAction. My beforeFilter does have some Session calls and a
ClassRegistry::init, along with settings for the Security and Auth
components. If I figure things out better than this, I will update
this thread.

Thanks.

Gary

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Running the action twice?

2009-12-11 Thread bujanga
I will dig into this error today, busy yesterday. I intend to monitor
the server logs and build the actions up until I see the reload
behavior.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Running the action twice?

2009-12-10 Thread Jeff Deroshia
I actually just noticed the same behavior today.  For testing an email
method, I called it at the end of an index action.  I got two copies of the
email.  Normally, the mail will be sent after filtering through some
conditionals, so I don't think it will be a problem.  I do have a connect
method assigned to the action I was testing in. Other than that, I don't
know why the index action was called twice.

Jeff

On Thu, Dec 10, 2009 at 12:24 PM, Dr. Loboto  wrote:

> You can check is it "internal redirect" (like requestAction) or actual
> one by checking HTTP requests. If there are two HTTP request you need
> to search redirect in code, if no - the problem is in requestAction or
> setAction or direct call of this method.
>
> On Dec 10, 8:18 pm, bujanga  wrote:
> > There was a requestAction called from my layout BUT I disabled it
> > during troubleshooting. In fact, All links to js, css, and images are
> > stripped from my layout and views. I have no beforeRender or
> > afterFilter.
> >
> > View still reloads. Odd thing is, it goes twice when called via a
> > redirect from another action but not when it is refreshed by F5.
> >
> >  Getting frustrated. Will check to see if other views are going twice.
> >
> > Gary
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Running the action twice?

2009-12-10 Thread Dr. Loboto
You can check is it "internal redirect" (like requestAction) or actual
one by checking HTTP requests. If there are two HTTP request you need
to search redirect in code, if no - the problem is in requestAction or
setAction or direct call of this method.

On Dec 10, 8:18 pm, bujanga  wrote:
> There was a requestAction called from my layout BUT I disabled it
> during troubleshooting. In fact, All links to js, css, and images are
> stripped from my layout and views. I have no beforeRender or
> afterFilter.
>
> View still reloads. Odd thing is, it goes twice when called via a
> redirect from another action but not when it is refreshed by F5.
>
>  Getting frustrated. Will check to see if other views are going twice.
>
> Gary

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Running the action twice?

2009-12-10 Thread bujanga
There was a requestAction called from my layout BUT I disabled it
during troubleshooting. In fact, All links to js, css, and images are
stripped from my layout and views. I have no beforeRender or
afterFilter.

View still reloads. Odd thing is, it goes twice when called via a
redirect from another action but not when it is refreshed by F5.

 Getting frustrated. Will check to see if other views are going twice.

Gary

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Running the action twice?

2009-12-09 Thread Dr. Loboto
requestAction somewhere? In a view, or beforeRender, or afterFilter
maybe?

On Dec 10, 5:05 am, bujanga  wrote:
> I have looked over this code many times and really just don't know why
> this is happening. It seems that cake is performing the action twice.
> How do I know this? I am receiving 2 of each email. If I put an exit
> statement before the end of the action, I only receive 1 of each
> email.
>
> As a background, I am using Security->requireSecure() in my
> beforeFilter along with the blackHoleCallback = 'forceSSL'  callback
> shown in the book.http://book.cakephp.org/view/268/Usage
>
> Here is my action:
> --
> function pmt_receipt($tid=NULL, $pid=NULL, $cid=NULL){
>         if ( isset($this->params['named']['tid']) ){
>                 $tid = $this->params['named']['tid'];
>                 $pid = $this->params['named']['pid'];
>                 $cid = $this->params['named']['cid'];
>         }
>         if ( is_null($tid) || is_null($pid) || is_null($cid) )
> $this->redirect(array('action'=>'pmt_error', 0008));
>
>         $purchase_formatted = 
> $this->PurchaseModel->ggis_format_purchase($pid);
>         $purchase_formatted .= 
> $this->CcPaymentechChpp->ggis_format_payment($cid);
> //      NOTIFY BY EMAIL
>         $this->Transaction->emailnotify($tid);
> //      SUBSCRIBE TO EMAIL LIST
>         $this->Transaction->newslettersubscribe($tid);
> //      REMOVE DATA FROM THE SESSION
>         $this->Session->delete('purchase');
>
>         $purchase_msg = 'Your credit card has been successfully
> processed. Please print a copy of this page as your receipt.';
>         $purchase_msg .= 'Shortly you will receive an email, reiterating
> the information on this page.';
>         $this->CreditCard = ClassRegistry::init('CreditCard');
>         $this->set('formOptions', $this->CreditCard->get_formOptions());
>         $this->set('purchase_msg', $purchase_msg);
>         $this->set('purchase_formatted', $purchase_formatted);}
>
> --
>
> The emailnotify and newslettersubscribe methods have been working
> without issue for other controllers for quite some time.
>
> Any help would be greatly appreciated. Thank you.
>
> Gary Dalton

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Running the action twice?

2009-12-09 Thread bujanga
I have looked over this code many times and really just don't know why
this is happening. It seems that cake is performing the action twice.
How do I know this? I am receiving 2 of each email. If I put an exit
statement before the end of the action, I only receive 1 of each
email.

As a background, I am using Security->requireSecure() in my
beforeFilter along with the blackHoleCallback = 'forceSSL'  callback
shown in the book. http://book.cakephp.org/view/268/Usage

Here is my action:
--
function pmt_receipt($tid=NULL, $pid=NULL, $cid=NULL){
if ( isset($this->params['named']['tid']) ){
$tid = $this->params['named']['tid'];
$pid = $this->params['named']['pid'];
$cid = $this->params['named']['cid'];
}
if ( is_null($tid) || is_null($pid) || is_null($cid) )
$this->redirect(array('action'=>'pmt_error', 0008));

$purchase_formatted = $this->PurchaseModel->ggis_format_purchase($pid);
$purchase_formatted .= 
$this->CcPaymentechChpp->ggis_format_payment($cid);
//  NOTIFY BY EMAIL
$this->Transaction->emailnotify($tid);
//  SUBSCRIBE TO EMAIL LIST
$this->Transaction->newslettersubscribe($tid);
//  REMOVE DATA FROM THE SESSION
$this->Session->delete('purchase');

$purchase_msg = 'Your credit card has been successfully
processed. Please print a copy of this page as your receipt.';
$purchase_msg .= 'Shortly you will receive an email, reiterating
the information on this page.';
$this->CreditCard = ClassRegistry::init('CreditCard');
$this->set('formOptions', $this->CreditCard->get_formOptions());
$this->set('purchase_msg', $purchase_msg);
$this->set('purchase_formatted', $purchase_formatted);
}
--

The emailnotify and newslettersubscribe methods have been working
without issue for other controllers for quite some time.

Any help would be greatly appreciated. Thank you.

Gary Dalton

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en