Smarty assign in UDT does not work with Chrome only?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
creopard
Forum Members
Forum Members
Posts: 82
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

Smarty assign in UDT does not work with Chrome only?

Post 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?
User avatar
creopard
Forum Members
Forum Members
Posts: 82
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

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

Post 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.
User avatar
creopard
Forum Members
Forum Members
Posts: 82
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

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

Post 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 ???
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1713
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

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

Post 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.
Not getting the answer you need? CMSMS support options
User avatar
creopard
Forum Members
Forum Members
Posts: 82
Joined: Fri Nov 10, 2017 10:25 am
Location: .de
Contact:

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

Post 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!
Post Reply

Return to “CMSMS Core”