ZF-3828: ViewRenderer render actions with wrong view script when used with actionStack and multiple modules
Description
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.
Comments
Posted by Patrick Barroca (patbator) on 2008-08-03T11:53:58.000+0000
typos corrected
Posted by Thomas Weidner (thomas) on 2008-08-24T14:24:52.000+0000
Assigned to right component