View previous topic :: View next topic |
Author |
Message |
ajaxian Smarty Rookie
Joined: 11 Jun 2011 Posts: 5
|
Posted: Sat Jun 11, 2011 5:50 pm Post subject: how to upgrade smarty, from 2.6.18 to 3.0.8 |
|
|
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 |
|
tommim Smarty Rookie
Joined: 08 Jun 2011 Posts: 23
|
Posted: Sat Jun 11, 2011 10:40 pm Post subject: |
|
|
The function is called "assign" - not "set". Check your file C:\xampp\htdocs\dresses\admin\modules\body.php at line 7. |
|
Back to top |
|
ajaxian Smarty Rookie
Joined: 11 Jun 2011 Posts: 5
|
Posted: Sun Jun 12, 2011 8:27 am Post subject: |
|
|
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 |
|
ajaxian Smarty Rookie
Joined: 11 Jun 2011 Posts: 5
|
Posted: Sun Jun 12, 2011 9:10 am Post subject: |
|
|
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 |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Sun Jun 12, 2011 9:29 am Post subject: |
|
|
unknown modifier "numberFormat" in /.../orders_new_orders.html" on line 125
try
|number_format:2:".":","
or write your own. |
|
Back to top |
|
tommim Smarty Rookie
Joined: 08 Jun 2011 Posts: 23
|
Posted: Sun Jun 12, 2011 9:32 am Post subject: |
|
|
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 |
|
ajaxian Smarty Rookie
Joined: 11 Jun 2011 Posts: 5
|
Posted: Sun Jun 12, 2011 9:50 am Post subject: |
|
|
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 |
|
Aristophan Smarty Regular
Joined: 10 Jan 2011 Posts: 96
|
Posted: Sun Jun 12, 2011 12:54 pm Post subject: |
|
|
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. |
|
Back to top |
|
ajaxian Smarty Rookie
Joined: 11 Jun 2011 Posts: 5
|
Posted: Sun Jun 12, 2011 5:46 pm Post subject: |
|
|
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. |
thanks for the tips and help.. really appreciated. |
|
Back to top |
|
|