ZF-3812: Zend_Controller_Action_Helper_ActionStack does not preserve Request Parameters

Description

The ActionStack Action Helper accepts a parameter list similar to the Url View Helper and gotoRoute() method of the Redirector Action Helper, but it does not preserve Request Parameters like its cousins. Example:


$this->_helper->ActionStack->actionToStack($action);

One would expect the Request object pushed onto the ActionStack to have the requested $action, the current Controller and Module specifications AND the current Request Parameters, but it ignores the params completely. Instead, workaround with:


$this->_helper->ActionStack->actionToStack($action, null, null, $this->_getAllParams();

I also have a patch to submit for ActionStack that addresses this frustrating behavior AND permits the developer to selectively pass params in an predictable manner. I'll attach that to the ticket once it's created.

Comments

The use case for this patch is simple: "Rather than having to always pass the Request parameters to ActionStack::actionToStack(), collect the existing Request params if $params is not passed but allow a null set (empty array) to be passed for $params."

Uses:


$this->_helper->ActionStack('action', 'controller', 'module');
// Add Module_ControllerController::actionAction() to the stack while retaining the current Request parameters.
// Either 'module' or 'controller' can be omitted to use the current values.

$this->_helper->ActionStack('action', 'controller', 'module', array());
// As above, but pass no Request parameters to the new Request object pushed onto the stack.

$this->_helper->ActionStack('action', 'controller', 'module', array(
    'param' => $this->_getParam('param'),
));
// Also as above, but only pass the Request parameter 'param' to the stack.

Just correcting my JIRA wiki syntax. Why are there so many of these...!?

Assigning to Ralph.

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.