Upgrade from 1.x to 2.x

A short and concise manual to help you upgrade your CMS Made Simple website to the latest 2.x release.

  1. Preparations

  1. Check the servers PHP version before upgrade for PHP 5.4.11 or higher
  2. Create a back-up of files and database
  3. Upgrade CMSMS to version 1.12.2 »
  4. Perform all third party module upgrades.
  5. Clean/remove all unneeded templates and stylesheets
  6. Clean/remove all not used third party modules and plugins.
  7. Change Admin Theme to the core default OneEleven

  2. Check third party plugins

Not all plugins are already updated by its developer to be compatible with CMSMS 2.x.

Check before upgrading this list: http://dev.cmsmadesimple.org/project/list_tagged/CMSMS-2


  3. Smarty Scope

Smarty introduces the concept of 'scopes' in templates. This version of Smarty does not treat each and every variable as a global. This will solve problems with Smarty variables being inadvertently overwritten, but will cause problems with websites that rely on some global variables.

Formerly, you could create a variable in a module template (for example the News detail template could set a canonical variable) and then use that variable in another template, such as in the portion of your page template. Though this is still possible, an additional step is required.
Some examples:

Templates
Current
{content assign=content}
New
{content assign=content}
{$content=$content scope=global}

Or a bit shorter:

{$content="{content}" scope=global}


Current
{content block=second assign=content2}
New
{$content2="{content block=second}" scope=global}


Current
{description assign=description}
{title assign=page_title}
New
{$description="{description}" scope=global}
{$page_title="{title}" scope=global}


Current
{capture assign=foo}
  ...
  ...
{/capture}
New
{capture assign=foo}
  ...
  ...
{/capture}
{$foo=$foo scope=global}


Current
{assign var=canonical value=$entry->canonical}
New
{assign var=canonical value=$entry->canonical scope=global}

Or a bit shorter:

{$canonical=$entry->canonical scope=global}


Current
{$canonical=$entry->canonical}
{$page_title=$entry->title}
New (only in CMSMS 2.x)
{$canonical=$entry->canonical}
{$page_title=$entry->title}

{share_data data='page_title,canonical' scope=global}

Stylesheets
Current
[[capture assign=theme_url]][[uploads_url]]/template[[/capture]]
New
[[$theme_url="[[uploads_url]]/template" scope=global]]


Current
[[$my_red='#EF4A46']]
New
[[$my_red='#EF4A46' scope=global]]

  4. The upgrade!

Now we have done preperations, we can start the real upgrade process!

  1. Create a new back-up of files and database.
  2. CHMOD config.php 644
  3. Download the latest cmsms-2.x.x-install.zip file and unzip it localy.
  4. Read the included readme.txt file for more information.
  5. Upload the installer file to the website root using the CMSMS File Manager.
  6. Perform the upgrade, by opening i.e. www.website.com/cmsms-2.x.x-install.php
  7. Remove the installer file...

  5. Necessary follow-up actions and known issues

  Smarty security setting

Syntax error in template "..." on line 1 "..." PHP function '...' not allowed by security setting.

Add to your config.php file:

$config['permissive_smarty'] = 1;

This config variable loosens some of the security configuration for smarty templates. Particularly enabling this option allows the use of any PHP function as a Smarty plugin. You better not use this option if you are allowing content to be submitted for display on your website from untrusted sources! If a function works without this line, you better not add it!


  Template names

During the upgrade the CMSMS Install Assistent might rename page and core module templates to ensure all names are unique.

In a few cases you need to change them at your website:

  • If you use template names in module tags, i.e. {news summarytemplate='foobar'}
  • In default page templates with template inheritance, i.e. {extends file='template:foobar'}