ZF-12417: Missing migration notes - Zend_View_Helper_Navigation proxy to helper methods cannot be found
Description
After upgrading from ZF 1.11.11 to 1.12.0 I get the following error:
Zend_Controller_Exception: Bad method call:
Unknown method Zend_Navigation::menu
#0 [internal function]: Zend_Navigation_Container->__call('menu', Array)
#1
The error disappears when: - I downgrade to 1.11.10 (could not find 1.11.11 but I use that version in production and it works fine) - I comment out {{$this->navigation()->menu()}} and {{...->breadcrumbs()}} in my layout.phtml
Apparently the proxies to the navigation helper methods cannot be found, falling back to Zend_Navigation_Container
Comments
Posted by Frank Brückner (frosch) on 2012-09-12T05:48:06.000+0000
Hi Timmo, thanks for your report.
Please put the following line in your layout script and post the result here.
Thanks!
Posted by Frank Brückner (frosch) on 2012-09-12T06:59:56.000+0000
Can you also provide the error message with the full stack trace?
Posted by Timmo Henseler (zensys) on 2012-09-12T07:30:14.000+0000
helper paths:
array 'Zend_View_Helper_' => array 0 => string 'Zend/View/Helper/' (length=17) 1 => string '/home/user/domains/myapp/application/views/helpers/' (length=62) 'Zend_View_Helper_Navigation_' => array 0 => string 'Zend/View/Helper/Navigation/' (length=28) 'Application_View_Helper_' => array 0 => string '/home/user/domains/myapp/application/views/helpers/' (length=62) 'My_View_Helper_' => array 0 => string '/home/user/domains/myapp/application/../../../library/php/My/views/helpers/' (length=87) 'ZendX_JQuery_View_Helper_' => array 0 => string '/usr/local/zend/share/ZendFramework/library/ZendX/JQuery/View/Helper/' (length=69) 'Zym_View_Helper_' => array 0 => string '/home/user/domains/myapp/application/../../../library/php/Zym/View/Helper/' (length=85)
error message and call stack:
( ! ) Fatal error: Uncaught exception 'Zend_Navigation_Exception' with message 'Bad method call: Unknown method Zend_Navigation::menu' in /usr/local/zend/share/ZendFramework/library/Zend/Controller/Plugin/Broker.php on line 336 ( ! ) Zend_Navigation_Exception: Bad method call: Unknown method Zend_Navigation::menu in /usr/local/zend/share/ZendFramework/library/Zend/Navigation/Container.php on line 366 Call Stack
Time Memory Function Location
1 0.0024 325048 {main}( ) ../index.php:0 2 0.2795 1514772 Zend_Application->run( ) ../index.php:45 3 0.2795 1514772 Zend_Application_Bootstrap_Bootstrap->run( ) ../Application.php:366 4 0.2798 1514828 Zend_Controller_Front->dispatch( ) ../Bootstrap.php:97 5 1.0316 3064992 Zend_Controller_Plugin_Broker->postDispatch( ) ../Front.php:965 6 1.1115 3087956 Zend_Controller_Plugin_ErrorHandler->postDispatch( ) ../Broker.php:333 7 1.1115 3087956 Zend_Controller_Plugin_ErrorHandler->_handleError( ) ../ErrorHandler.php:223 ( ! ) Zend_Controller_Exception: Bad method call: Unknown method Zend_Navigation::menu
0 [internal function]: Zend_Navigation_Container->__call('menu', Array)
1 [internal function]: Zend_Navigation->menu()
2 /usr/local/zend/share/ZendFramework/library/Zend/View/Helper/Navigation/HelperAbstract.php(561): call_user_func_array(Array, Array)
3 /usr/local/zend/share/ZendFramework/library/Zend/View/Helper/Navigation.php(132): Zend_View_Helper_Navigation_HelperAbstract->__call('menu', Array) #4 /home/user/domains/myapp/application/layouts/scripts/layout.phtml(39): Zend_View_Helper_Navigation->__call('menu', Array)
5 /home/user/domains/myapp/application/layouts/scripts/layout.phtml(39): Zend_View_Helper_Navigation->menu()
6 /usr/local/zend/share/ZendFramework/library/Zend/View.php(108): include('/home/user...')
7 /usr/local/zend/share/ZendFramework/library/Zend/View/Abstract.php(888): Zend_View->_run('/home/user...')
8 /usr/local/zend/share/ZendFramework/library/Zend/Layout.php(796): Zend_View_Abstract->render('layout.phtml')
9 /usr/local/zend/share/ZendFramework/library/Zend/Layout/Controller/Plugin/Layout.php(143): Zend_Layout->render()
10 /usr/local/zend/share/ZendFramework/library/Zend/Controller/Plugin/Broker.php(333): Zend_Layout_Controller_Plugin_Layout->postDispatch(Object(Zend_Controller_Request_Http))
11 /usr/local/zend/share/ZendFramework/library/Zend/Controller/Front.php(965): Zend_Controller_Plugin_Broker->postDispatch(Object(Zend_Controller_Request_Http))
12 /usr/local/zend/share/ZendFramework/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
13 /usr/local/zend/share/ZendFramework/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
14 /home/user/domains/myapp/public/index.php(45): Zend_Application->run()
15 {main} in /usr/local/zend/share/ZendFramework/library/Zend/Controller/Plugin/Broker.php on line 336
Call Stack
Time Memory Function Location
1 0.0024 325048 {main}( ) ../index.php:0 2 0.2795 1514772 Zend_Application->run( ) ../index.php:45 3 0.2795 1514772 Zend_Application_Bootstrap_Bootstrap->run( ) ../Application.php:366 4 0.2798 1514828 Zend_Controller_Front->dispatch( ) ../Bootstrap.php:97
Posted by Frank Brückner (frosch) on 2012-09-12T07:48:46.000+0000
Okay, thanks!
Can you check this in your layout script:
````
Posted by Timmo Henseler (zensys) on 2012-09-12T08:36:14.000+0000
With ZF 1.12 that is:
```
With ZF 1.11.10 I do get the helper
Posted by Frank Brückner (frosch) on 2012-09-12T08:45:04.000+0000
All my applications works fine with 1.12!
Please check outside your application:
Posted by Timmo Henseler (zensys) on 2012-09-12T09:06:44.000+0000
I am not sure if this is relevant but I use Zend Server CE (on Ubuntu 12.04) with a different repository (to have SSL support with Ubuntu 12.04)
Posted by Timmo Henseler (zensys) on 2012-09-12T09:11:14.000+0000
I get:
HomePosted by Frank Brückner (frosch) on 2012-09-12T09:14:15.000+0000
Okay, fine!
Now you can check this in your application. (Put it at the end of your layout script!)
Posted by Timmo Henseler (zensys) on 2012-09-12T10:12:27.000+0000
I get the same error message as before. But isn't that the (fatal) error of my earlier menu() call which prevents your lines (at the end) from being executed?
Posted by Frank Brückner (frosch) on 2012-09-12T10:13:55.000+0000
Yes, your are right. Please comment out your navigation helper calls. Sorry!
Posted by Timmo Henseler (zensys) on 2012-09-12T13:00:44.000+0000
Posted by Frank Brückner (frosch) on 2012-09-12T13:12:39.000+0000
Thanks for your support!
I looked into the "Zym" library and I think there is the problem: {{Zym_View_Helper_Menu}}! Rename these helper and it should run.
The behavior is described here: ZF-10458
Posted by Timmo Henseler (zensys) on 2012-09-12T15:29:26.000+0000
Yes, after renaming Zym/View/Helper/Menu.php and also .../Breadcrumbs.php my problem was solved. Am I correct in understanding that a fix to some added functionality previous to 1.12 was lost in 1.12?
Perhaps off-topic but the reason I use Zym is mainly to directly access the view in a view helper. Is this perhaps supported in ZF without Zym now? If so I would remove Zym altogether.
Posted by Timmo Henseler (zensys) on 2012-09-12T15:39:56.000+0000
How can I edit my comment above? I see some personal data that I would like to remove.
Posted by Frank Brückner (frosch) on 2012-09-12T15:56:29.000+0000
{quote}Am I correct in understanding that a fix to some added functionality previous to 1.12 was lost in 1.11?{quote} Yes, in old versions your own navigation helpers could not have the name "menu" or "breadcrumbs".
{quote}Perhaps off-topic but the reason I use Zym is mainly to directly access the view in a view helper.{quote} Your view helper must extends {{Zend_View_Helper_Abstract}} and then you can use {{$this->view}} inside the helper. The abstract class was added in version 1.6.0.
Posted by Frank Brückner (frosch) on 2012-09-12T15:57:23.000+0000
{quote}How can I edit my comment above? I see some personal data that I would like to remove.{quote} Roll with the mouse cursor over our comment and you will see on the right side a pencil.
Posted by Frank Brückner (frosch) on 2012-09-12T16:21:11.000+0000
I think we must add some migration notes to the docs. I will change this issue type to "Docs: Improvement".
Posted by Frank Brückner (frosch) on 2013-01-18T07:41:56.000+0000
Fixed on trunk (25226) and release-1.12 (25227)