Page 1 of 1

Smarty assign in UDT does not work with Chrome only?

Posted: Thu May 16, 2024 10:18 am
by creopard
Not sure if it is a bug or a problem on my side.
I have different outputs on Chrome based browsers and the Firefox browser?

I'm trying to reproduce the exact same example as shown here:
https://docs.cmsmadesimple.org/tags/use ... le-to-page

so after creating the UDT like

Code: Select all

$name = 'Mark';
$other_name = 'Goran';

$smarty->assign('name', $name);
$smarty->assign('other_name', $other_name);
and adding it to the template accordingly:

Code: Select all

{my_udt}
<p>Howdy {$name}!<br />
Hello {$other_name}!</p>
Only Firefox produces the expected output:
Howdy Mark!
Hello Goran!
However, in Chrome and Edge I only get:
Howdy !
Hello !
The Smarty variables are empty in that case?!
How's that possible? Is that some browser based security setting I'm not aware of?

Can anybody reproduce this weird issue?

Re: Smarty assign in UDT does not work with Chrome only?

Posted: Thu May 16, 2024 11:45 am
by creopard
Seems to be an issue with my template.
Tested the {my_udt} example on another site with 2.2.0 successfully on various browsers.

Re: Smarty assign in UDT does not work with Chrome only?

Posted: Thu May 16, 2024 11:59 am
by creopard
ok I found the issue:

do NOT set the option "Settings - Global Settings" -> "Smarty Settings" -> "Enable Smarty Caching:" to "yes" if you are using logics like in the example mentioned above!

It only works with Firefox browsers, but not with Chrome based browsers ???

Re: Smarty assign in UDT does not work with Chrome only?

Posted: Thu May 16, 2024 1:24 pm
by DIGI3
It's more likely it worked with the browser you were logged into admin with, as being logged in bypasses caching. You should only use Smarty caching if you really, really, really know what you're doing - we're going to be changing or removing that in a future release.

Re: Smarty assign in UDT does not work with Chrome only?

Posted: Thu May 16, 2024 3:05 pm
by creopard
DIGI3 wrote: Thu May 16, 2024 1:24 pm It's more likely it worked with the browser you were logged into admin with
Oh thanks, that's a good point!
I was only logged in with Firefox indeed!