Page 1 of 1

Arrays in CMSMS 1.11.x

Posted: Fri Oct 19, 2012 8:53 pm
by msaluste
I've tried this before, but got an erroneous answer that clean install solves it all.

I've had UDT named "no_feedback" in two of my CMSMS 1.10.x installations (two providers in different countries: Arvixe and Zone) for a long-long time. It is like this:

Code: Select all

$gCms = cmsms();
$nofb = array("home","how-to-use","faq","contact-form","sitemap","google-custom-search","news","site-news","archived-news","testbed","search-results");
$nohd = array("news","site-news","archived-news");
$smarty = $gCms->GetSmarty();
$smarty->assign('no_fb',$nofb);
$smarty->assign('no_hd',$nohd);
This does not work in 1.11.x installation (incl. clean install) anymore - UDT saves fine, but after I add "{no_feedback}" to my template, page load fails.
Debug reads:
ERROR: at line 806 in file /home/.../lib/smarty/sysplugins/smarty_internal_templatebase.php:

Message:

Call of unknown method 'capture_error'.
Full trace:

#0 /home/.../tmp/templates_c/f86d86ab39c1bb93a1b057df0c3d0155eccd402c.tpl_body.22.php(94): Smarty_Internal_TemplateBase->__call('capture_error', Array)
#1 /home/.../tmp/templates_c/f86d86ab39c1bb93a1b057df0c3d0155eccd402c.tpl_body.22.php(94): Smarty_CMS->capture_error()
#2 /home/.../lib/smarty/sysplugins/smarty_internal_templatebase.php(180): content_5081b8de847cc6_71463133(Object(Smarty_Internal_Template))
#3 /home/.../lib/classes/class.Smarty_CMS.php(334): Smarty_Internal_TemplateBase->fetch('tpl_body:22', 'p15', NULL, NULL, false, false, false)
#4 /home/.../index.php(239): Smarty_CMS->fetch('tpl_body:22')
#5 {main}
This does not work on upgrades from 1.10.x nor on clean English-only installs of 1.11.x (tried this on both hosts in two different countries). No additional modules were added after clean install.

I feel like a complete idiot already, so please do not answer a la "Tested this on my installation and it works". It does not, add the UDT to your template and refresh your page properly.

Re: Arrays in CMSMS 1.11.x

Posted: Mon Oct 22, 2012 8:45 am
by msaluste
Finally solved this myself. After trying out a bunch of different approaches, it appeared that the line "$smarty = $gCms->GetSmarty();" was the root of all evil. Each and every UDT failed after adding this line, so the whole problem was not related to arrays at all.

Just replacing "$smarty" with something else (e.g. "$smart") solved the problem.

BTW, I haven't seen a notice that $smarty is not allowed in 1.11.x.