ZF-3828: ViewRenderer render actions with wrong view script when used with actionStack and multiple modules


We create an action stack as follow :

||Module||Controller||Action|| |Module1|Index|Index| |Module3|Index|Index| |Module2|Index|Index| |Module1|Index|Index|

As dispatching takes place, ViewRenderer adds base script paths to its Zend_View object, leading to the following base paths array :

[0] => '../application/modules/module3/views/scripts/', [1] => '../application/modules/module2/views/scripts/', [2] => '../application/modules/module1/views/scripts/'

In this case the last action called, Module1/Index/Index as actionStack is LIFO, is rendered with ../application/modules/module3/views/scripts/index.phtml.

We fixed it by extending ViewRenderer and reseting base script paths array at each initView call.

By the way, this could/should be better fixed as having same action names across multiple modules is not that rare.


typos corrected

Assigned to right component