CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#8989] If you declare a function in a UDT you can't edit a page with content type set to Advanced Content

avatar
Created By: delaunay (pierrepercee)
Date Submitted: Wed Feb 27 10:55:37 -0500 2013

Assigned To:
Version: None
CMSMS Version: 1,11,4
Severity: Major
Resolution: Invalid
State: Closed
Summary:
If you declare a function in a UDT you can't edit a page with content type set to Advanced Content
Detailed Description:
The same UDT : function test{echo "world";}  
works
well on front-side but you can't edit the page when content type is advanced
content.(in fact when you try to "apply" it doesn't work and when you "send" it
gives
errors). But when the type is "content" it works well and you can edit the page.

If you have an UDT with just "echo "World";  and no declared
function it works well whatever the content type of the page is.

Declaring a function seems to be also problematic with the news module if you
use the UDT in the content block of one News. It works well if you use your UDT
in a news template !
As the {} are using to declare a function in PHP I think there's something
wrong in the
CMSMS core when parsing UDT.


History

Comments
avatar
Date: 2013-02-27 11:06
Posted By: Robert Campbell (calguy1000)

I created a UDT with a sample function in it:  i.e:

function my_test() { echo "my_test functionc alled<br/>"; }
my_test();

Then called this UDT in content page, news summary, and detail templates.
No problems encountered.


      
avatar
Date: 2013-02-27 11:16
Posted By: Tapio Löytty (Stikki)

Same thing here, tested it multiple times, and there was no error.

It might be problem of AC complexity, not core related.

And to be honest, if you are trying to declare functions inside UDT, your are
doing something wrong.

UDT is ment for simple scripting.

-Stikki-
      
avatar
Date: 2013-02-27 11:57
Posted By: delaunay (pierrepercee)

@Calguy:

I use your UDT to test with news. 

If you put it in the News summary block content:
The homepage where the news module is called works perfectly but if you click on
[more] to read the entire content of the news, the page is broken with no css at
all.

In a "normal" page with content type set to "content" the UDT works well, I know
("But when the type is "content" it works well and you can edit the page.")

With module Advanced Content installed, you can't even set the content type to
"Advanced Content" if you put this UDT in your page template before choosing the
content type !

If you set content type to "advanced content" and only  after you put your UDT
in your page template there's something wrong when you try to edit (can't send
or apply)

@Stikki
Sorry, I'm not a developper, but using function seem's not to be something very
complex...It's very basic in fact.
In older versions of CMSMS, 1.10.3 for example,  it worked well...
      
avatar
Date: 2013-02-27 12:03
Posted By: Robert Campbell (calguy1000)

Putting the UDT into the News summary template AND the detail page at the same
time will generate an error (function already exists).  Which a programmer can 
understand and work around quite easily.

If you are messing with php scripting you need to be able to see and understand
the error messages that can and will be generated.   This is not a core issue.

By your own words this issue does not happen with the CMSMS core, but with
Advanced content.

Bug Report changed to invalid.
      
avatar
Date: 2013-02-27 12:49
Posted By: delaunay (pierrepercee)

Sorry, I work on Win...( I know it's not very...:-) ) with Wampserver  2.2  but
:

I try another time with a just installed version :

First i create the UDT {okyes} :

function my_test() { echo "my_test functionc alled<br/>"; }
my_test();

Second: I open the first news and put the {okyes} (html view enabled)  in the
summary block of this news.

Then I actualize the home page. As News summary block has now a content (your
UDT) you can see a [read more] under the news. I you click this link  to read
the entire news, the page is broken (no css).

Open the first news another time, delete the UDT in the summary block, put
"ABCD" in the summary block and nows it's working well !

As it's problematic for me on "News" and "Advanced content" it realy seem's to
be a core issue.

I have never said i have used the UDT at the same time " into the News summary
template AND the detail page " !
For Windows users there's definitively something wrong with parsing UDT !

      
avatar
Date: 2013-02-27 14:03
Posted By: Robert Campbell (calguy1000)

This is not a core issue, it's a programming issue.
      
Updates

Updated: 2013-02-27 14:03
resolution_id: 11 => 9
state: Open => Closed

Updated: 2013-02-27 11:06
resolution_id: => 11