CMSMS 2.0 Update

Project Announcements. This is read-only, as in... not for problems/bugs/feature request.
Post Reply
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

CMSMS 2.0 Update

Post by calguy1000 »

It has been a bit since I last updated you on the status of 2.0, and since we are getting close to finished, and there is some important news I thought it was time to drop you a line.

CMSMS 2.0 has undergone extensive testing lately by the ever helpful and constructive members of the french community, and by the members of the dev team. We have fixed numerous problems with the installation and upgrade process, fixed issues with locking in the content manager, fixed issues with the Design manager and a thousand other small, but important things.

We have also changed all core modules that output to the frontend of the site (Search, ModuleManager, News, Navigator) to use a new smarty variable scope for their output so that variables created in one module cannot stomp on another module's variables. This also may have positive performance implications though we haven't specifically tested this.

We have spent a great deal of time analysing and optimizing the code for performance, specifically focussing on database query optimization, and reducing database queries where possible. We also under took various code optimizations particularly where that code was executed for frontend requests and the core API. As we were at a state of diminishing returns we did not specifically optimize all code particularly if it was only for some admin requests.

Most recently the smarty guys released Smarty 3.1.24. Their latest public release in quite a while. This release reportedly improves template compile time by 30 to 40 percent, and introduces numerous security fixes. It was our thought that this was going to be the best opportunity for a while (if our tests succeeded) to upgrade smarty and to remove our hacks.

For those of you who attended the geekmoot you will remember in my presentation that I stated one of our goals for after 2.0 was to go to a 'pure smarty'. Well, the opportunity presented itself early.

Our tests indicate that this version of smarty (3.1.24) is stable, and works properly (previous versions had significant bugs, at least one of which we reported). So we have upgraded CMSMS 2.0 to use a pure, un-modified version of smarty.

Although this is great news in itself, it is unfortunate that this will cause problems for a significant percentage of people upgrading their sites from CMSMS 1.x. This is due to the way smarty now deals with variable scopes and sub templates.

In CMSMS 1.x it was assumed and documented that all smarty variables were available at all time, and never disappeared. If you created a variable (lets say 'page_title' in a module template called from the {content} tag that was called from within the </__body> section of your page template, that variable {$page_title} would be available within the <head> section of your page template.

Unfortunately, that is no longer true without explicit action by you. In smarty (now that CMSMS is using an un-modified version of Smarty), sub templates create their own scope. And there is a hierarchy of templates. Variables are copied from parent scopes into child scopes, but are not copied from the child to the parent. Making a smarty variable persistent across multiple scopes requires explicit action by the site developer (specifically you).

Fortunately, it is relatively easy to copy a local variable in a sub template, into a global variable for use in the parent, or other peer templates. And we have added a new smarty plugin to the core to help even more.

If you remember the stock News detail template there was a line such as this:

Code: Select all

{assign var='canonical' value=$entry->canonical}
That created a smarty variable called 'canonical' that was then used in the <head> portion of the page template to create the <link rel="canonical"> tag.
Because of the new smarty scoping methodology, that syntax now looks like this:

Code: Select all

{assign var='canonical' value=$entry->canonical scope=global}
Additionally, the {share_data} plugin will allow you to specify numerous local variables that should be copied to the global scope. i.e:

Code: Select all

{share_data scope=global vars='page_title,canonical,page_description'}
CMSMS uses smarty sub-templates extensively. The most obvious ones are the {content} tags, module templates, like {News}, {Search}, or {Navigator}. However the three portions of the page template (above the HTML tag, from </__body> down, and the head section) are each individual sub templates. Thus, without explicit action variables created in the top section are now not available in the body.

Where we go from here:
At this time we are going to quickly undertake one more round of internal testing to make sure we haven't recently introduced any critical errors. After a sufficient group of dev team members have tested the release and consider it reasonable we will freeze commits except for bug fixes, and issue a public release candidate. We will also be generating twice daily public snapshots of the release candidate.

Although a little behind schedule, we hope that the release candidate will run for four to six weeks, at which time we will kick it out there.

So, there is good news mixed in with the bad (a little sugar with the medicine). Stay tuned, and thank you for your time.
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.
Post Reply

Return to “Announcements”