#5661: Controller: redirect() files using custom components
-------------------------+--------------------------------------------------
    Reporter:  danfreak  |          Type:  Bug       
      Status:  new       |      Priority:  Medium    
   Milestone:  1.2.x.x   |     Component:  Controller
     Version:  RC3       |      Severity:  Normal    
    Keywords:            |   Php_version:  PHP 5     
Cake_version:            |  
-------------------------+--------------------------------------------------
 I have problem using a custom component calling


 {{{
 $this->controller->redirect(array('action'=>'index'), null, true);
 }}}


 after a successfull add() or edit($id)

 Looking at Controller::redirect() I noticed that in
 
[https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/controller/controller.php#L490
 cake/libs/controller/controller.php]

 if in the component there isn't a beforeRedirect() method

 
[https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/controller/component.php#L142
 Component::beforeRedirect()] always returns '''$response''' as an empty
 array()

 Therefore if $response is an empty array()
 
[https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/controller/controller.php#L490
 line#490] condition
 
[https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/controller/controller.php#L494
 #line494] won't be satisfact ($resp is an empty array and not strictly
 null) and

 The redirect $url
 
(https://trac.cakephp.org/browser/branches/1.2.x.x/cake/libs/controller/controller.php#L495
 #line495) will be overwritten to an empty array()

 Therefore redirect fails to redirect to the destination specified in

 {{{
 $this->controller->redirect(array('action'=>'index'), null, true);
 }}}


 {{{

 }}}

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5661>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" 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/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to