Page 1 of 1

Smarty Error: Unable to load template after update to 2.2.16

Posted: Mon Oct 31, 2022 2:10 am
by paynor
Any suggestions appreciated, last time I did any maintenance on the CMSMS was a few years ago and I have forgotten anything I once knew about Smarty tags..

Had functional site in CMSMS 1.12.1 on hosted server using PHP 7.4
Hosting provider will soon force all users to PHP 8.x
So I had to update to a CMSMS version that works on PHP 8.x (Have been putting this off for years).
I removed modules that are not available on CMSMS 2.x and cleared the cache. Changed admin template to the recommended. Backed up files and DB.
Then tried an incremental update, starting with the CMSMS 2.0 php installer.
At the second step the installer hangs with a white screen.
Same thing for versions 2.1, 2.2.4 and 2.2.7.
So I jumped directly to 2.2.16.
Using this version, the installer works fine, detects the existing 1.12.1 installation and does the update with no errors shown.
The admin console works fine, everything UI looks normal. The admin log is posted further down below.
The site itself throws an error :
ERROR at line 185 of file {installed path}/Lib/smarty/sysplugins/smarty_internal_template.php:
ERROR MESSAGE:
Unable to load template 'file:NCLEANBLUE : cssmenu_ulshadow' in 'tpl_body:12'

TRACK TRACE:
#0 {installed path}/lib/smarty/sysplugins/smarty_internal_templatebase.php(216): Smarty_Internal_Template->render(false, 1)
#1 {installed path}/lib/smarty/sysplugins/smarty_internal_templatebase.php(122): Smarty_Internal_TemplateBase->_execute(Object(CMS_Smarty_Template), NULL, NULL, NULL, 1)
#2 {installed path}/modules/MenuManager/action.default.php(195): Smarty_Internal_TemplateBase->display()
#3 {installed path}/lib/classes/class.CMSModule.php(1403): include('/customers/a/d/...')
#4 {installed path}/lib/classes/class.CMSModule.php(1479): CMSModule->DoAction('default', 'mbe227', Array, '16')
#5 {installed path}/lib/module.functions.php(106): CMSModule->DoActionBase('default', 'mbe227', Array, '16', Object(CMS_Smarty_Template))
#6 {installed path}/assets/plugins/function.menu.php(22): cms_module_plugin(Array, Object(CMS_Smarty_Template))
#7 {installed path}/tmp/templates_c/bedd56d13e2ef3d1e712f64e9409e0539e17bcc1_0.tpl_body.12.php(66): smarty_cms_function_menu(Array, Object(CMS_Smarty_Template))
#8 {installed path}/lib/smarty/sysplugins/smarty_template_resource_base.php(128): content_635eee6c7858f6_85125527(Object(CMS_Smarty_Template))
#9 {installed path}/lib/smarty/sysplugins/smarty_template_compiled.php(172): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(CMS_Smarty_Template))
#10 {installed path}/lib/smarty/sysplugins/smarty_internal_template.php(206): Smarty_Template_Compiled->render(Object(CMS_Smarty_Template))
#11 {installed path}/lib/smarty/sysplugins/smarty_internal_templatebase.php(216): Smarty_Internal_Template->render(false, 0)
#12 {installed path}/lib/smarty/sysplugins/smarty_internal_templatebase.php(107): Smarty_Internal_TemplateBase->_execute(Object(CMS_Smarty_Template), 'p16', NULL, NULL, 0)
#13 {installed path}/lib/classes/internal/class.CMS_Smarty_Template.php(20): Smarty_Internal_TemplateBase->fetch(NULL, 'p16', NULL, NULL)
#14 {installed path}/index.php(160): CMS_Smarty_Template->fetch()
#15 {main}
The admin log :
admin 1 Admin Username: admin Logged In 30 Oct 2022 21:34:42
Smarty Error Unable to load template 'file:NCLEANBLUE : cssmenu_ulshadow' in 'tpl_body:12' 30 Oct 2022 21:34:22
Smarty Error Unable to load template 'file:NCLEANBLUE : cssmenu_ulshadow' in 'tpl_body:12' 30 Oct 2022 21:34:21
Module Installed AdminSearch version 1.0.6 30 Oct 2022 21:34:12
Module Installed CMSContentManager version 1.1.9 30 Oct 2022 21:34:12
Module Upgraded module CMSMailer to version 6.2.14 30 Oct 2022 21:34:12
Module Installed CmsJobManager version 0.1.3 30 Oct 2022 21:34:12
Module Installed DesignManager version 1.1.9 30 Oct 2022 21:34:12
Module Upgraded module FileManager to version 1.6.12 30 Oct 2022 21:34:12
Module Installed FilePicker version 1.0.5 30 Oct 2022 21:34:12
3 CMSMS Template Type navigation Created 30 Oct 2022 21:34:12
14 CMSMS Template sitename_standard_cssmenu Created 30 Oct 2022 21:34:12
15 CMSMS Template mm-default Created 30 Oct 2022 21:34:12
16 CMSMS Template NCLEANBLUE_cssmenu_ulshadow Created 30 Oct 2022 21:34:12
17 CMSMS Template NCLEANBLUE_minimal_menu Created 30 Oct 2022 21:34:12
Module Upgraded module MenuManager to version 1.50.3 30 Oct 2022 21:34:12
Module Installed MicroTiny version 2.2.5 30 Oct 2022 21:34:12
Module Upgraded module ModuleManager to version 2.1.8 30 Oct 2022 21:34:12
4 CMSMS Template Type navigation Created 30 Oct 2022 21:34:12
5 CMSMS Template Type breadcrumbs Created 30 Oct 2022 21:34:12
18 CMSMS Template Simple Navigation Created 30 Oct 2022 21:34:12
19 CMSMS Template Breadcrumbs Created 30 Oct 2022 21:34:12
20 CMSMS Template cssmenu Created 30 Oct 2022 21:34:12

Re: Smarty Error: Unable to load template after update to 2.2.16

Posted: Mon Oct 31, 2022 1:57 pm
by DIGI3
Try commenting out your {menu} tag(s), it looks like it's calling a template that is either no longer there or has changed names. If that fixes it, temporarily change the {menu} tag(s) to call a template that's in DesignManager, or remove the template parameter altogether, if it has one, and let it load whichever one you have set as default (make sure one is).

As MenuManager has been deprecated and soon to be removed, the more permanent solution is to switch all of your {menu} tags to {Navigator} and use Navigator templates.

Re: Smarty Error: Unable to load template after update to 2.2.16

Posted: Mon Oct 31, 2022 2:52 pm
by paynor
it looks like it's calling a template that is either no longer there or has changed names.
Thanks for the suggestion.
Strange that according to the admin log, the "missing" template was created in the update process:
16 CMSMS Template NCLEANBLUE_cssmenu_ulshadow Created 30 Oct 2022 21:34:12
This is the same template that cannot be loaded 9 seconds later:
Smarty Error Unable to load template 'file:NCLEANBLUE : cssmenu_ulshadow' in 'tpl_body:12' 30 Oct 2022 21:34:21
Try commenting out your {menu} tag(s),
A beginner question I know, but I am veerry rusty... in what file do I comment out the {menu} tag(s) ?

Re: Smarty Error: Unable to load template after update to 2.2.16

Posted: Mon Oct 31, 2022 3:48 pm
by DIGI3
It looks like it's looking for a file-based template but the template in question is likely a database template. I wouldn't be able to determine why that's the case without digging into your site but it's probably not worth worrying about.

Smarty comments are {* *} so you could do {*menu*} or {* {menu} *}

Re: Smarty Error: Unable to load template after update to 2.2.16

Posted: Tue Nov 01, 2022 2:32 am
by paynor
Solved thanks.
Just had to correct the name of the missing template in the sites main template and in one other template
"NCLEANBLUE : cssmenu_ulshadow"
to "
NCLEANBLUE_cssmenu_ulshadow"