ZF-5518: Zend_View_Helper_Action tries to render wrong view script
Description
I have 3 modules in my project. Default, Forum and News. On my startpage (Which is IndexController and indexAction of the default module) in the view script file i have $this->action('list', 'index', 'news'), but it won't render the right list.phtml which is the one in my news module, it tries to render the list.phtml in my default module, but it don't have one so it returns an empty string. When i created list.phtml in my default module and put "hello" in it, then it will show the "Hello" string on my startpage.
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2009-01-11T09:50:05.000+0000
Assigning to Ralph.
Posted by Carl Broberg Gunnarsson (psil) on 2009-01-16T00:48:20.000+0000
I modified the _script method of the Zend_View_Abstract class into the following code
Maybe not the most elegant code, but it does the trick.
Posted by Carl Broberg Gunnarsson (psil) on 2009-01-16T01:12:46.000+0000
Ignore my previous post
This is the working method
{quote} /** * Finds a view script from the available directories. * * @param $name string The base name of the script. * @return void */ protected function _script($name) { if (0 == count($this->_path['script'])) { require_once 'Zend/View/Exception.php'; throw new Zend_View_Exception('no view script directory set; unable to determine location for view script', $this); }
{quote}
Posted by Jon Whitcraft (sidhighwind) on 2009-02-06T13:01:22.000+0000
Calle,
Can you post a patch file instead of the updated code. This can be fixed faster that way.
Thanks.
Jon
Posted by Carl Broberg Gunnarsson (psil) on 2009-02-06T17:18:42.000+0000
Here is my patched Zend_View_Helper_Action
Posted by Carl Broberg Gunnarsson (psil) on 2009-02-06T17:26:02.000+0000
The former file i uploaded (Action.php) is wrong!
This is the correct patched file, im sorry for the wrong upload, im a bit tired at the moment.
Posted by Till Klampaeckel (till) on 2009-08-13T08:27:29.000+0000
Same error on 1.9.1. I never had to explicitly set the view directory up to 1.7.8.
Still trying to trace why this is the case. I'm using the modular structure.
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-08-13T08:52:08.000+0000
You're aware that using the action view helper is generally considered bad practice? http://rmauger.co.uk/2009/03/…
Posted by Till Klampaeckel (till) on 2009-08-13T10:13:17.000+0000
This is my error messages. Unfortunately not related to the action helper. It doesn't look like it at least.
Posted by Till Klampaeckel (till) on 2010-03-19T11:14:26.000+0000
Ok, we switched to Zend_Layout.
I used {{addBasePath()}} on {{Zend_View}} and that seems to have effectively fix it for me. I'm not sure why I needed that all of a sudden.
Posted by Matthew Weier O'Phinney (matthew) on 2010-03-19T11:43:07.000+0000
Does that mean we can mark the issue as resolved now?
Posted by Pádraic Brady (padraic) on 2010-03-19T11:59:26.000+0000
Looks like it can be worked around, but the problem is still there. Give it a week or two, I assigned it to myself after exchanging emails with Till, so I'll investigate more thoroughly over the weekend. There's also several patched files attached claiming to resolve this without needing a workaround or change in practice.
Till, can you explain more precisely what your resolution was for the record?
Posted by Ralph Schindler (ralph) on 2011-02-18T15:14:24.000+0000
Any ideas or movement here?