Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

how to upgrade smarty, from 2.6.18 to 3.0.8

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
ajaxian
Smarty Rookie


Joined: 11 Jun 2011
Posts: 5

PostPosted: Sat Jun 11, 2011 5:50 pm    Post subject: how to upgrade smarty, from 2.6.18 to 3.0.8 Reply with quote

hi everybody,

i have custom CMS both front end and admin side is developed using smarty template engine. i would like to update smarty to latest version

my problem is when i try to replace lib folder with current version .. my front website show nothing.. blank page and source.. and from admin side this error message occurs

Fatal error: Uncaught exception 'SmartyException' with message 'property '' does not exist.' in C:\xampp\htdocs\dresses\libs\Smarty.class.php:752 Stack trace: #0 [internal function]: Smarty->__call('set', Array) #1 C:\xampp\htdocs\dresses\admin\modules\body.php(7): Smarty->set('site_name', 'dresses') #2 C:\xampp\htdocs\dresses\admin\index.php(116): include_once('C:\xampp\htdocs...') #3 {main} thrown in C:\xampp\htdocs\dresses\libs\Smarty.class.php on line 752

i cant figure out what is the problem.. if plz some one have any idea please help me

Thanks & Regards
Back to top
View user's profile Send private message
tommim
Smarty Rookie


Joined: 08 Jun 2011
Posts: 23

PostPosted: Sat Jun 11, 2011 10:40 pm    Post subject: Reply with quote

The function is called "assign" - not "set". Check your file C:\xampp\htdocs\dresses\admin\modules\body.php at line 7.
Back to top
View user's profile Send private message
ajaxian
Smarty Rookie


Joined: 11 Jun 2011
Posts: 5

PostPosted: Sun Jun 12, 2011 8:27 am    Post subject: Reply with quote

tommim wrote:
The function is called "assign" - not "set". Check your file C:\xampp\htdocs\dresses\admin\modules\body.php at line 7.


thanks for reply

i am also use $template->set with assign...

i dont understand complete site structure stop working.. front is complete blank also admin side giving errors..

just want to know the process of upgrading .... i just delete libs older folder and place new one .. any thing else needs to be changed?... or replaced?
Back to top
View user's profile Send private message
ajaxian
Smarty Rookie


Joined: 11 Jun 2011
Posts: 5

PostPosted: Sun Jun 12, 2011 9:10 am    Post subject: Reply with quote

tommim wrote:
The function is called "assign" - not "set". Check your file C:\xampp\htdocs\dresses\admin\modules\body.php at line 7.



thanks tommim your solution works i changed all 'set; funtions to 'assign' now front side i working fine but admin still have error ... like


Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "C:/xampp/htdocs/dresses/admin/templates/orders/orders_new_orders.html" on line 125 "<td align="left" class="tdSubBg">{$orders[o].order_price|numberFormat}</td>" unknown modifier "numberFormat"' in C:\xampp\htdocs\dresses\libs\sysplugins\smarty_internal_templatecompilerbase.php:441 Stack trace: #0 C:\xampp\htdocs\dresses\libs\sysplugins\smarty_internal_compile_private_modifier.php(62): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown modifie...', 125) #1 C:\xampp\htdocs\dresses\libs\sysplugins\smarty_internal_templatecompilerbase.php(286): Smarty_Internal_Compile_Private_Modifier->compile(Array, Object(Smarty_Internal_SmartyTemplateCompiler), Array, NULL, NULL) #2 C:\xampp\htdocs\dresses\libs\sysplugins\smarty_internal_templatecompilerbase.php(125): Smarty_Internal_TemplateCompilerBase->callTagCompiler('private_modifie...', Array, Array) #3 C:\xampp\htdo in C:\xampp\htdocs\dresses\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 441
Back to top
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 96

PostPosted: Sun Jun 12, 2011 9:29 am    Post subject: Reply with quote

unknown modifier "numberFormat" in /.../orders_new_orders.html" on line 125
try
|number_format:2:".":","
or write your own.
Back to top
View user's profile Send private message
tommim
Smarty Rookie


Joined: 08 Jun 2011
Posts: 23

PostPosted: Sun Jun 12, 2011 9:32 am    Post subject: Reply with quote

Because you have accidentally deleted the customer's hand-made plugins when you upgraded. There is no Modifier called numberFormat.

So check your old directories for a custom modifier called "numberFormat".

I sounds like it could be a simple wrapper for the php function number_format. The docs are here: http://de.php.net/manual/de/function.number-format.php

So as a quick-fix you may either try to copy the old file or just register the original PHP-function as a modifier using this code:

$smarty->registerPlugin(Smarty::PLUGIN_MODIFIER, 'numberFormat', 'number_format');

EDIT: @Aristophan I see you were typing a little faster than I was ^^
Back to top
View user's profile Send private message
ajaxian
Smarty Rookie


Joined: 11 Jun 2011
Posts: 5

PostPosted: Sun Jun 12, 2011 9:50 am    Post subject: Reply with quote

tommim wrote:
Because you have accidentally deleted the customer's hand-made plugins when you upgraded. There is no Modifier called numberFormat.

So check your old directories for a custom modifier called "numberFormat".

I sounds like it could be a simple wrapper for the php function number_format. The docs are here: http://de.php.net/manual/de/function.number-format.php

So as a quick-fix you may either try to copy the old file or just register the original PHP-function as a modifier using this code:

$smarty->registerPlugin(Smarty::PLUGIN_MODIFIER, 'numberFormat', 'number_format');

EDIT: @Aristophan I see you were typing a little faster than I was ^^



thanks Aristophan and tommin

just copied old function


function smarty_modifier_numberFormat($number,$currency=null)

{

return $currency.number_format($number,2,'.',',');

}
Back to top
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 96

PostPosted: Sun Jun 12, 2011 12:54 pm    Post subject: Reply with quote

All php-functions can be used as modifiers implicitly as long as security isn't enabled. Never use modifiers which do the same, if you don't need to. Wink
Back to top
View user's profile Send private message
ajaxian
Smarty Rookie


Joined: 11 Jun 2011
Posts: 5

PostPosted: Sun Jun 12, 2011 5:46 pm    Post subject: Reply with quote

Aristophan wrote:
All php-functions can be used as modifiers implicitly as long as security isn't enabled. Never use modifiers which do the same, if you don't need to. Wink



thanks for the tips and help.. really appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP