comanage-dev - Re: [comanage-dev] r387 - registry/trunk/app/Controller
Subject: COmanage Developers List
List archive
- From: Benn Oshrin <>
- To:
- Subject: Re: [comanage-dev] r387 - registry/trunk/app/Controller
- Date: Mon, 22 Oct 2012 15:12:32 -0400
This ended up being pretty easy.
performRedirect() is a StandardController function that tries to figure out what redirect to issue after an operation completes. Marie recently modified it to add support for passing a tab to select on CoPerson or OrgIdentity views, for Models that requires_person.
Basically, the check for the redirect variable should have been done within the requires_person check, but instead that check was happening later. As such, when a Controller that did not requires_person triggered a StandardController::performRedirect, viewVars['redirect'] wouldn't have been set.
You can see the details in the diff.
-Benn-
On 10/22/12 2:58 PM,
wrote:
Author: benno
Date: 2012-10-22 14:58:05 -0400 (Mon, 22 Oct 2012)
New Revision: 387
Modified:
registry/trunk/app/Controller/StandardController.php
Log:
Fix redirect expectations (CO-493)
Modified: registry/trunk/app/Controller/StandardController.php
===================================================================
--- registry/trunk/app/Controller/StandardController.php 2012-10-16
19:16:11 UTC (rev 386)
+++ registry/trunk/app/Controller/StandardController.php 2012-10-22
18:58:05 UTC (rev 387)
@@ -682,24 +682,23 @@
*/
function performRedirect() {
- $redirect = $this->viewVars['redirect'];
-
- // Sets tab to be opened by co_people page via jquery
- if($this->viewVars['redirect']['controller'] == 'co_people'
- || $this->viewVars['redirect']['controller'] == 'org_identities') {
- if($this->redirectTab)
- $redirect['tab'] = $this->redirectTab;
- }
-
if($this->requires_person) {
+ $redirect = $this->viewVars['redirect'];
+
+ // Sets tab to be opened by co_people page via jquery
+ if($this->viewVars['redirect']['controller'] == 'co_people'
+ || $this->viewVars['redirect']['controller'] == 'org_identities') {
+ if($this->redirectTab)
+ $redirect['tab'] = $this->redirectTab;
+ }
+
$this->set('redirect', $redirect);
$this->redirect($redirect);
- }
-
- if(isset($this->cur_co))
+ } elseif(isset($this->cur_co)) {
$this->redirect(array('action' => 'index', 'co' =>
Sanitize::html($this->cur_co['Co']['id'])));
- else
+ } else {
$this->redirect(array('action' => 'index'));
+ }
}
/**
- [comanage-dev] r387 - registry/trunk/app/Controller, svnlog, 10/22/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller, Benn Oshrin, 10/22/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller, Scott Koranda, 10/22/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller, Marie Huynh, 10/22/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller (CO-494), Benn Oshrin, 10/23/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller (CO-494), Marie Huynh, 10/23/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller (CO-494), Benn Oshrin, 10/23/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller, Marie Huynh, 10/22/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller, Scott Koranda, 10/22/2012
- Re: [comanage-dev] r387 - registry/trunk/app/Controller, Benn Oshrin, 10/22/2012
Archive powered by MHonArc 2.6.16.