View previous topic :: View next topic |
Author |
Message |
cosmicx Smarty Rookie
Joined: 04 Jul 2012 Posts: 8
|
Posted: Tue Jul 10, 2012 3:51 pm Post subject: Help On Updating to Version 3.1.11 |
|
|
hello experts,
newbie here, and i am trying to update my smarty version from 2.6.x.x to 3.1.11.
but after doing so, i'm getting this error.
i'm not yet knowledgeable in php/smarty tags, only html/css is all i know.
...and inlude tag is all i know about smarty.
Refer To this Image |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jul 10, 2012 8:44 pm Post subject: |
|
|
You should read the README file which has notes about API changes in Smarty3.
So $smarty->register_object(...) is now $smarty->registerObject(...) |
|
Back to top |
|
cosmicx Smarty Rookie
Joined: 04 Jul 2012 Posts: 8
|
Posted: Wed Jul 11, 2012 7:13 am Post subject: |
|
|
thanks...
i think i did it correctly... but there's an error
this one
Code: |
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "D:\My Documents\_Wamp\www\templates\organic_V0\featured.html" on line 25 "{capture name=some_content assign=details_url}{if $seo_settings.enable_mod_rewrite}[b]{seo->makeDetailsLink p1=`$featured[loop].id` p2=`$featured[loop].title`}[/b]{else}{$live_site}/details.php?id={$featured[loop].id}{/if}{/capture}" - Unexpected "`"' in D:\My Documents\_Wamp\www\libs\sysplugins\smarty_internal_templatecompilerbase.php:656 Stack trace: #0 D:\My Documents\_Wamp\www\libs\sysplugins\smarty_internal_templateparser.php(3139): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 D:\My Documents\_Wamp\www\libs\sysplugins\smarty_internal_templateparser.php(3204): Smarty_Internal_Templateparser->yy_syntax_error(79, '`') #2 D:\My Documents\_Wamp\www\libs\sysplugins\smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(79, '`') #3 D:\My Documents\_Wamp\www\libs\sysplugins\smarty_internal_templatecompil in D:\My Documents\_Wamp\www\libs\sysplugins\smarty_internal_templatecompilerbase.php on line 656
|
in the above block of codes... please refer to this code
{seo->makeDetailsLink p1=`$featured[loop].id` p2=`$featured[loop].title`}
when i actually open the "featured.html" file
instead of the code "{seo->makeDetailsLink p1=`$featured[loop].id` p2=`$featured[loop].title`}",
i find
{seo->makeDetailsLink p1=`$featured[loop].id` p2=`$featured[loop].title`}
the problem is, the ">" symbol is interpreted as > in the error code.
the ">" is being parsed as entity...??? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Jul 12, 2012 5:22 pm Post subject: |
|
|
There is a syntax error because of the backticks. Backticks are only used if you included Smarty variables in double quoted strings.
The correct code is
Code: | {seo->makeDetailsLink p1=$featured[loop].id p2=$featured[loop].title}
|
But it looks like that Smarty2 did accept unexpected the backticks as in your example. |
|
Back to top |
|
cosmicx Smarty Rookie
Joined: 04 Jul 2012 Posts: 8
|
Posted: Fri Jul 13, 2012 1:02 am Post subject: |
|
|
@U.Tews
that worked... I've open all html files of my theme and got rid of all " ` " from the html files.
my test site loaded up, but with lots of further errors.
Code: | Notice: Undefined index: last in D:\My Documents\_My WAMP\www\temp\339072a0f71cb9295b3cac6c8ce832d1096f188f.file.tree_categories.html.php on line 92 |
it seem all errors are related to the TEMP directory.
REFERENCE IMAGE |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Jul 13, 2012 12:18 pm Post subject: |
|
|
The undefined index notices are much likely caused by corresponding undefined template variables in your templates. Smarty2 did suppress by default PHP E_NOTICE during template processing.
In Smarty 3 you may have do disable E_NOTICE manually by setting something like
$smarty->error_reporting = E_ALL & ~E_NOTICE; |
|
Back to top |
|
cosmicx Smarty Rookie
Joined: 04 Jul 2012 Posts: 8
|
Posted: Fri Jul 13, 2012 12:43 pm Post subject: |
|
|
i have no idea on how to do that... any documentation i can refer to? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Jul 13, 2012 4:39 pm Post subject: |
|
|
Code: | $smarty->error_reporting = E_ALL & ~E_NOTICE; |
The above does enable reporting for all errors but no notices.
Other option is to fix the undefined variables in your templates. |
|
Back to top |
|
cosmicx Smarty Rookie
Joined: 04 Jul 2012 Posts: 8
|
Posted: Fri Jul 13, 2012 4:45 pm Post subject: |
|
|
so the above codes will hide all error notices, i see.
but i'd rather fix the template, but I don't know again where to start.
i've applied the code, the site displays the theme correctly and no error notices anymore, but sitll, i want to get rid of the errors.
==
about this error
# Time Memory Function Location
1 0.0010 405328 {main}( ) ..\index.php:0
2 0.3408 8859640 Smarty_Internal_TemplateBase->display( ) ..\index.php:87
its tells about display() in my index.php file in line 87.
that line 87 of my index.php is this one:
Code: | $smarty->display('index.html'); |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Jul 14, 2012 8:16 am Post subject: |
|
|
Quote: | Notice: Undefined index: last in D:\My Documents\_My WAMP\www\temp\339072a0f71cb9295b3cac6c8ce832d1096f188f.file.tree_categories.html.php on line 92 |
The above error is generated when you are using a template variable $last in your template tree_categories.html but it was not assigned in your PHP script or in template before it was used.
Quote: | 1 0.0010 405328 {main}( ) ..\index.php:0
2 0.3408 8859640 Smarty_Internal_TemplateBase->display( ) ..\index.php:87
|
Is a part of the PHP traceback call stack.
The method display() of the $smarty object is defined in the class Smarty_Internal_TemplateBase
But what was the complete error message? |
|
Back to top |
|
|