Details
-
Type:
Docs: Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.9.5
-
Component/s: Zend_Controller
-
Labels:None
Description
When calling _forward(), the method just injects the arguments into the request, aka module, controller, action, and set the dispatch token to false.
The problem is when we call _forward() from an init() method of an action controller.
In that case, the dispatcher tries to load the action, but keeps the actual controller as to be dispatched instead of taking the one which could have been specified in _forward().
That special use case should be patched in the dispatch() method of the ZC_Action class.
class MyController extends Zend_Controller_Action { public function init() { $this->_forward('someaction', 'somecontroller'); } // ... }
That code will ask for the dispatching of MyController / someaction ; instead of someController / someaction
This needs to be addressed. We just ran into it and spent a lot of time trying to figure out why our _forward() wasn't being respected correctly.