Following Error : New PHP

General project discussion. NOT for help questions.
Post Reply
ohaldi
New Member
New Member
Posts: 8
Joined: Wed Feb 18, 2009 5:46 pm

Following Error : New PHP

Post by ohaldi »

Hello, I have the following error :
Fatal error: Uncaught Error: Call to undefined function each() in /home/httpd/vhosts/haldi.ch/httpdocs/cms/modules/MenuManager/MenuManager.module.php:111 Stack trace: #0 /home/httpd/vhosts/haldi.ch/httpdocs/cms/modules/MenuManager/action.default.php(183): MenuManager->GetChildNodes(Object(cms_content_tree), Array, Object(CmsApp), 1, 0, Array, 1, Array, 1) #1 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/classes/class.CMSModule.php(1407): include('/home/httpd/vho...') #2 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/classes/class.CMSModule.php(1483): CMSModule->DoAction('default', 'm87d21', Array, '15') #3 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/functions/module.functions.php(106): CMSModule->DoActionBase('default', 'm87d21', Array, '15', Object(CMS_Smarty_Template)) #4 /home/httpd/vhosts/haldi.ch/httpdocs/cms/assets/plugins/function.menu.php(22): cms_module_plugin(Array, Object(CMS_Smarty_Template)) #5 /home/httpd/vhosts/haldi.ch/httpdocs/cms/tmp/templates_c/d99cf3aa25268e7ae5585236412acde3dfbfebc9_0.tpl_body.10.php(49): smarty_cms_function_menu(Array, Object(CMS_Smarty_Template)) #6 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/smarty/sysplugins/smarty_template_resource_base.php(123): content_6740b431596ce2_39799855(Object(CMS_Smarty_Template)) #7 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/smarty/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(CMS_Smarty_Template)) #8 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/smarty/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(Object(CMS_Smarty_Template)) #9 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/smarty/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render(false, 0) #10 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/smarty/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute(Object(CMS_Smarty_Template), 'p15', NULL, NULL, 0) #11 /home/httpd/vhosts/haldi.ch/httpdocs/cms/lib/classes/internal/class.CMS_Smarty_Template.php(20): Smarty_Internal_TemplateBase->fetch(NULL, 'p15', NULL, NULL) #12 /home/httpd/vhosts/haldi.ch/httpdocs/cms/index.php(160): CMS_Smarty_Template->fetch() #13 {main} thrown in /home/httpd/vhosts/haldi.ch/httpdocs/cms/modules/MenuManager/MenuManager.module.php on line 111


GPT : tell me that I encounter (Call to undefined function each()) indicates that the PHP function each() is used in the code, but it has been removed as of PHP 7.2.
I changed in MenuManager.module.php Line 111 from each() to foreach() but didn't help. Now I get this error:
Parse error: syntax error, unexpected token "foreach" in /home/httpd/vhosts/haldi.ch/httpdocs/cms/modules/MenuManager/MenuManager.module.php on line 111
Solution from GPT.
I'm not a guru in PHP. could some body help me ?
ohaldi
New Member
New Member
Posts: 8
Joined: Wed Feb 18, 2009 5:46 pm

Re: Following Error : New PHP

Post by ohaldi »

I uninstalled MenuManager.module.php. Now I can see my webside. But no menu, no navigation!
My version is : 2.2.21.
jce76350
Beta Tester
Beta Tester
Posts: 2069
Joined: Mon May 29, 2006 1:20 pm
Location: Rouen

Re: Following Error : New PHP

Post by jce76350 »

what is the your CMSms version
MenuManager is deprecated
see CHANGELOG.txt Version 2.2.20 - Saguenay -> - MenuManager is no longer installed back on upgrades;
Use Navigator : recommended since 2014 ;)
Jean-Claude Etiemble MyPageFr
ohaldi
New Member
New Member
Posts: 8
Joined: Wed Feb 18, 2009 5:46 pm

Re: Following Error : New PHP

Post by ohaldi »

>Use Navigator: recommended since 2014
Hello, thank you very much for your quick reply.
Okay, I'll switch to Navigator.
Quick question: is it difficult to switch from MenuManager.module.php to Navigator?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1757
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Following Error : New PHP

Post by DIGI3 »

Navigator does things a bit differently, mostly in that it's recursive. Looking at the sample templates should get you started - often you can use one and just adjust the classes to what they were in your MM template.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “General Discussion”