Re: Problem with controller redirect
One other point: I have a beforeSave() call in my model. When I disable that callback the redirect works fine. But even if all the callback does is return true, the problem noted below will occur.
With callback and no modification to Controller.php the redirect fails. With no callback and no modification to Controller.php the redirect works fine. With callback and some output sent within redirect() in Controller.php, the redirect works fine.
Odd.
On Wednesday, August 8, 2012 6:00:27 PM UTC-5, aquariman wrote:
-- On Wednesday, August 8, 2012 6:00:27 PM UTC-5, aquariman wrote:
Hello,Cake 2.1.3. Here's what I've got in my controller:function company_info() {if ($this->request->is('post')) {if ($this->Business->save($this->request->data)) { $this->redirect($this->request->here); } else {$this->raiseWarning('Your information could not be saved');}}}Problem is, when Cake gets to $this->redirect() it craps out, causing no output and no redirect (blank screen). Logs show me nothing. However, very weirdly, if I go to the redirect() method in /lib/Cake/Controller.php and make the following change at line 788:if ($exit) {$this->response->send();echo 'some random text';$this->_stop();}Then it works!! ??? How is it that adding output here makes the redirect work properly? Is this a bug?Any help appreciated. Best,-Brian
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+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home