lost in a maze around cgsimple::get_root_alias()...

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
dlen
Forum Members
Forum Members
Posts: 67
Joined: Fri Apr 09, 2010 11:32 pm

lost in a maze around cgsimple::get_root_alias()...

Post by dlen »

Hello forists,

I just upgraded a site from cmsms 1.12.1 to 2.1.5.
I found out, that i had to replace
{$page_lang = substr($cgsimple->get_root_alias(),0,2)}
with
{$page_lang = substr($cgsimple::get_root_alias(),0,2)}

But this is not the end.

When I just cleared the cache, I get the following error message:

Code: Select all

ERROR: at line 176 in file /home/www/lib/smarty/sysplugins/smarty_internal_templatebase.php:
Invalid compiled template for 'tpl_top:2' 
and when I just hit 'reload' again, I get the following error message:

Code: Select all

parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in /home/www/tmp/templates_c/ceb3b38b3d624997db99371a7a2661b864f38ed5.tpl_top.2.php on line 35
The line in question in the cache php-file is (whole file attached)

Code: Select all

$_smarty_tpl->tpl_vars['page_lang']->value = substr($_smarty_tpl->tpl_vars['cgsimple']->value::get_root_alias(),0,2); $_smarty_tpl->tpl_vars['page_lang']->nocache = null; $_smarty_tpl->tpl_vars['page_lang']->scope = 3;
I must admit, that I have no clue where to look further - thankful for any constructive remark.
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

[The extension txt has been deactivated and can no longer be displayed.]

User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: lost in a maze around cgsimple::get_root_alias()...

Post by Rolf »

Yesterday this came up in the IRC too, it maybe help you too. It should be documented in the module help.

Code: Select all

{$root=cgsimple::get_root_alias()}
Hope it helps
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
dlen
Forum Members
Forum Members
Posts: 67
Joined: Fri Apr 09, 2010 11:32 pm

Re: lost in a maze around cgsimple::get_root_alias()...

Post by dlen »

Wow, it did help indeed. I was oviously using a "$" too many.

Apparently, within Smarty module names are not used with dollar-signs. Probably because the string is used "as is" to look up the object in the smarty parameter array. (Sorry, I am not in the "smarty zone" since a couple of month...these are all basics...)

Not so in an UDT. Here I have to use the "$" otherwise I get an error message already when trying to save. But I tried this:

Code: Select all

$smarty = cmsms() -> GetSmarty();
$cgsimple = $smarty->get_template_vars('cgsimple');
$root_alias = $cgsimple::get_root_alias();
and somehow $cgsimple isn't recognized properly, because i get

Code: Select all

Fatal error: Class name must be a valid object or a string in /home/www/lib/classes/class.usertagoperations.inc.php(278) : eval()'d code on line 5
Any hint welcome!
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: lost in a maze around cgsimple::get_root_alias()...

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
dlen
Forum Members
Forum Members
Posts: 67
Joined: Fri Apr 09, 2010 11:32 pm

Re: lost in a maze around cgsimple::get_root_alias()...

Post by dlen »

Thanks very much, I got this sorted out. Almost. Now struggeling with smarty scopes. But this will be another post, if any.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: lost in a maze around cgsimple::get_root_alias()...

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”