Page 1 of 1

[SOLVED] UDT error after upgrade to 1.11

Posted: Fri Aug 03, 2012 12:20 am
by rotezecke
hi,
I previously posted upgrade problems here:
http://forum.cmsmadesimple.org/viewtopi ... =3&t=62152
but I since fiddled around a fair bit and I think the syntax in some of my UDTs is to blame.

this is my error:

Code: Select all

Error: at line 806 in file /my/path/cmsms/lib/smarty/sysplugins/smarty_internal_templatebase.php

Message: Call of unknown method '_compile_source'.
and in debug mode I also get:

Code: Select all

#0 [internal function]: Smarty_Internal_TemplateBase->__call('_compile_source', Array)
#1 /var/www/cmsms/lib/classes/class.usertagoperations.inc.php(265) : eval()'d code(27): Smarty_CMS->_compile_source('temporary templ...', '{osc_cookie get...', NULL)
#2 /var/www/cmsms/tmp/templates_c/fc6d4015a0207ffcc00bd84890043ccaea513753.tpl_body.33.php(78): cms_user_tag_session_links(Array, Object(Smarty_CMS))
#3 /var/www/cmsms/lib/smarty/sysplugins/smarty_internal_templatebase.php(180): content_501b148008a4f5_14984023(Object(Smarty_Internal_Template))
#4 /var/www/cmsms/lib/classes/class.Smarty_CMS.php(329): Smarty_Internal_TemplateBase->fetch('tpl_body:33', 'p15', NULL, NULL, false, false, false)
#5 /var/www/cmsms/index.php(237): Smarty_CMS->fetch('tpl_body:33')
#6 {main}
I think the above means that my UDT {session_links} is to blame. I disabled the UDT in my template. after that a similar complaint came up about another UDT. I compared the UDTs and the one thing they have in common is they both call a {plugin} in a way I once copied from a tutorial:

Code: Select all

//using a {tag} in a UDT
  $smarty = cmsms()->GetSmarty();
  $smarty_data = "{print showbutton=false text='Print Preview' includetemplate='true'}";
  $smarty->_compile_source('temporary template', $smarty_data, $_compiled );
  @ob_start();
  $smarty->_eval('?>' . $_compiled);
  $_contents = @ob_get_contents();
  @ob_end_clean();
  echo $_contents ;
//end of using {tag}
When I disable my UDTs that use the above code my new install seems to work. Can anyone see what's wrong with the (once fine) syntax?

Thank you for your input.

By the way, even after I stripped my old install of all disabled modules and reactivated (unused) core modules (MicroTiny,Theme Manager), the upgrade still failed, and I had to rename News module as described in the above mention post.

CMSMS 1.11
CMSMailer 5.2.1
FileManager 1.4.0
MenuManager 1.8.2
ModuleManager 1.5.5
News 2.12.7
Search 1.7.6
TinyMCE 2.10.1
CGSimpleSmarty 1.5.1
CGExtensions 1.29.1
CGBlog 1.9.8
CGFeedback 1.5.7
Captcha 0.4.5
FormBuilder 0.7.3
IE6Warning 1.03
Showtime 3.2
CMSPrinting 1.0.2

Server: Linux Debian Lenny 2.6.26-1-686 kernel
apache 2.2.9-10
mysql 5.0.51a-24
php 5.2.6-1

Re: UDT error after upgrade to 1.11

Posted: Fri Aug 03, 2012 12:25 am
by calguy1000
Smarty3 is significantly different than smarty2.

The hidden/private method _compile_source (which was never intended for the use as described in your post)... is no longer available.

I suggest you read the smarty manual now.

Re: UDT error after upgrade to 1.11

Posted: Fri Aug 03, 2012 1:59 am
by rotezecke
so this post is no longer valid?
http://wiki.cmsmadesimple.org/index.php ... _.28UDT.29
Can that post be modified to
1) warn about smarty 3 incompatibility, and if possible,
2) a smarty 3 compatible solution.

Edit:
(my forum credentials are rejected on wiki for some reason).

Re: UDT error after upgrade to 1.11

Posted: Fri Aug 03, 2012 3:23 am
by Jos
You can update the wiki and add the warning yourself. You can login with your forum username/password ;)

Re: UDT error after upgrade to 1.11

Posted: Thu Aug 16, 2012 8:47 pm
by bess
a solution from a french member : Kraygoon (thanks to him)

http://www.cmsmadesimple.fr/forum/viewt ... 632#p29632
$smarty = cmsms()->GetSmarty();
$smarty_data = "{menu}";
@ob_start();
echo $smarty->display('string:'.$smarty_data) ;
$_contents = @ob_get_contents();
@ob_end_clean();
echo $_contents;

Re: UDT error after upgrade to 1.11

Posted: Thu Aug 16, 2012 8:59 pm
by calguy1000
That is totally redundant

Code: Select all

$smarty = cmsms()->GetSmarty();
$smarty_data = "{menu}"; // why?
$smarty->display('string:'.$smarty_data) ;
Edit:The echo statement was redundant.

Re: UDT error after upgrade to 1.11

Posted: Thu Aug 16, 2012 9:24 pm
by bess
thank you calguy1000 ;)

Re: [SOLVED] UDT error after upgrade to 1.11

Posted: Thu Aug 16, 2012 11:54 pm
by rotezecke
Thank you.