ANOMALY : UDT runs after Template save

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
atz6975
Forum Members
Forum Members
Posts: 34
Joined: Thu Jan 14, 2010 4:43 pm

ANOMALY : UDT runs after Template save

Post by atz6975 »

Hi,
I'm a little bit puzzled by the fact that everytime I save one specific template (default one) , it triggers the execution of one specific UDT.
This UDT does only one thing : error_log (some values from $POST and user IP)....
If I tail the file written by error_log ($mymessage,3,$mypath) I can clearly see that every time I "save" the template it executes the UDT....

Furthermore, ,this UDT is otherwise called within a global content inside an ajax page and every time I call that ajax pag the UDT code gets executed twice...

I'd be very grateful if someone could point me to my mistake or anything that could help.

Thank you very much for any thought or hint.
CMSMS version 1.11.4
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: ANOMALY : UDT runs after Template save

Post by calguy1000 »

UDT's are smarty plugins.... if they are included in a page template (even via a GCB) then they are called.

That includes when editing templates, and editing content.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
atz6975
Forum Members
Forum Members
Posts: 34
Joined: Thu Jan 14, 2010 4:43 pm

Re: ANOMALY : UDT runs after Template save

Post by atz6975 »

I understand now....
And I'm going to sort out the double execution...unless you can help me without knowing my code ::)

Edited : because it is two different issues and I don't want to make anybody angry...
atz6975
Forum Members
Forum Members
Posts: 34
Joined: Thu Jan 14, 2010 4:43 pm

Re: ANOMALY : UDT runs after Template save

Post by atz6975 »

Here is some fun info....
I used Postman Chrome extension and I built a page with only UDT call.
UDT simple logic is : delay( 1s), error_log( time())
Template of page is : {process_pagedata}{content}
Page content is : {UDT}

If I post
Url : /page
I get one write in file

If I post
Url : /page?showtemplate=false
I get two writes in log file with 1s different unix timestamp

So I have some questions:
Can anybody reproduce with 1.11.4? (thanks for your patience...)
How can I set the content header to 'application/json' if I return some json info?
I believe showtemplate=false is NOT necessary if my template doesn't return any nice layout, am I wrong?


Thank you x3
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: ANOMALY : UDT runs after Template save

Post by calguy1000 »

The running twice issue is a bug that has been solved in the upcoming version 1.11.5.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
atz6975
Forum Members
Forum Members
Posts: 34
Joined: Thu Jan 14, 2010 4:43 pm

[SOLVED] : UDT runs after Template save

Post by atz6975 »

YES!
I had a feeling it was odd...and thanks for the fix.

Is cmsms()->set_variable('content-type', 'application/json'); a good idea to set the content to json?
Post Reply

Return to “The Lounge”