Index: trunk/core/kernel/event_manager.php =================================================================== diff -u -N -r6093 -r6428 --- trunk/core/kernel/event_manager.php (.../event_manager.php) (revision 6093) +++ trunk/core/kernel/event_manager.php (.../event_manager.php) (revision 6428) @@ -289,6 +289,11 @@ // should do redirect but to no_permissions template if ( ($event->status == erSUCCESS || $event->status == erPERM_FAIL) && ($event->redirect === true || strlen($event->redirect) > 0)) { + // we need to pass category if the action was submitted to self-template, with the category passed + // and it has not explicly set redirect template or pass_cateogry param + if ($event->redirect === true && !isset($event->redirect_params['pass_category']) && $this->Application->GetVar('m_cat_id')) { + $event->redirect_params['pass_category'] = 1; + } $this->Application->Redirect($event->redirect, $event->redirect_params, null, $event->redirect_script); } } @@ -309,7 +314,8 @@ case 'd': // "down/push" new template to opener stack, deeplevel++ if ($this->Application->GetVar('front')) { - array_push($opener_stack, '../'.$this->Application->RecallVar('last_template') ); + $front_session =& $this->Application->recallObject('Session.front'); + array_push($opener_stack, '../'.$front_session->RecallVar('last_template') ); } else { array_push($opener_stack, $this->Application->RecallVar('last_template') ); @@ -334,18 +340,18 @@ $this->Application->StoreVar('opener_stack', serialize($opener_stack)); } - + function openerStackPush($t, $params, $pass = 'all') { $opener_stack = $this->Application->RecallVar('opener_stack'); - $opener_stack = $opener_stack ? unserialize($opener_stack) : Array(); - + $opener_stack = $opener_stack ? unserialize($opener_stack) : Array(); + $redirect_params = array_merge_recursive2(Array('m_opener' => 'u', '__URLENCODE__' => 1), $params); $new_level = $this->Application->BuildEnv($t, $redirect_params, $pass, true); array_push($opener_stack, 'index.php|'.ltrim($new_level, ENV_VAR_NAME.'=') ); $this->Application->StoreVar('opener_stack', serialize($opener_stack)); } - + function registerHook($hookto_prefix, $hookto_special, $hookto_event, $mode, $do_prefix, $do_special, $do_event, $conditional) { if( !$this->Application->prefixRegistred($hookto_prefix) )