Upgrade from smarty 2 to smarty 3 & 4

Author
Gregory
Publication
04/08/2023
04/08/2023
Update
04/13/2023
Rating
0.0 (0 vote)
Level
Normal
Upgrade from smarty 2 to smarty 3 & 4

Upgrade from smarty 2 to smarty 3 & 4 Since XOOPS 2.5.11-RC1 smarty 3 replaces smarty 2 and this can cause several problems on your website.
This tutorial will allow you to correct the errors that prevent your website from working properly.


To find the file to be modified, see the red insert on the previous page:
"Important : Search for the template file to be modified"


Error : SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 63

line 63 shows:

<{block id=3}>

To correct this error, you have to change block to xoBlock.

<{xoBlock id=3}>

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 33

line 33 shows:

<{foreach item=category from=$category}>

To correct this error, you have to change the content of the variable item (here "category") so that it is not identical to the content of the variable from (also "category").
You can change the content of the variable item and put for example "itemcategory" instead of "category".
Be careful ! It will also be necessary to change all the variables contained in the loop "foreach" and which begins with "category" by "itemcategory".

<{foreach item=itemcategory from=$category}>
...
<{if $itemcategory.logo != ''}>

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 33

line 33 shows:

<{foreachq item=itemcategory from=$category}>

To correct this error, you have to change foreachq to foreach.
Don't forget to change the closing tag as well.

<{foreach item=itemcategory from=$category}>
...
<{/foreach}>

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 62

line 62 shows:

<{includeq file="$content_template"}>

To correct this error, change includeq to include.

<{include file="$content_template"}>

The elements below are all corrected in the same way, by adding quotes.
Example : success.png 'success.png'

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 2

line 2 shows:

<{xoAdminIcons success.png}>;

To correct this error, you must surround success.png with quotes: 'success.png'.

<{xoAdminIcons 'success.png'}>;

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 30

line 30 shows:

<{xoAdminNav page.php}>

To correct this error, you must surround page.php with quotes: 'page.php'.

<{xoAdminNav 'page.php'}>

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 31

line 31 shows:

<{xoAppUrl user.php}>

To correct this error, you must surround user.php with quotes: 'user.php'.

<{xoAppUrl 'user.php'}>

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 51

line 51 shows:

<img src="<{xoModuleIcons16 edit.png}>" alt="<{$smarty.const._MA_XMNEWS_EDIT}>"></a>

To correct this error, you must surround edit.png with quotes: 'edit.png'.

<img src="<{xoModuleIcons16 'edit.png'}>" alt="<{$smarty.const._MA_XMNEWS_EDIT}>"></a>

Error: SmartyCompilerException: Syntax error in template "db:db:xmnewsadmincategory.tpl" on line 51

line 51 shows:

<img src="<{xoModuleIcons32 edit.png}>" alt="<{$smarty.const._MA_XMNEWS_EDIT}>"></a>

To correct this error, you must surround edit.png with quotes: 'edit.png'.

<img src="<{xoModuleIcons32 'edit.png'}>" alt="<{$smarty.const._MA_XMNEWS_EDIT}>"></a>