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

Help On Updating to Version 3.1.11

 
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 -> Documentation
View previous topic :: View next topic  
Author Message
cosmicx
Smarty Rookie


Joined: 04 Jul 2012
Posts: 8

PostPosted: Tue Jul 10, 2012 3:51 pm    Post subject: Help On Updating to Version 3.1.11 Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Jul 10, 2012 8:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
cosmicx
Smarty Rookie


Joined: 04 Jul 2012
Posts: 8

PostPosted: Wed Jul 11, 2012 7:13 am    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Jul 12, 2012 5:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
cosmicx
Smarty Rookie


Joined: 04 Jul 2012
Posts: 8

PostPosted: Fri Jul 13, 2012 1:02 am    Post subject: Reply with quote

@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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Jul 13, 2012 12:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
cosmicx
Smarty Rookie


Joined: 04 Jul 2012
Posts: 8

PostPosted: Fri Jul 13, 2012 12:43 pm    Post subject: Reply with quote

i have no idea on how to do that... any documentation i can refer to?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Jul 13, 2012 4:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
cosmicx
Smarty Rookie


Joined: 04 Jul 2012
Posts: 8

PostPosted: Fri Jul 13, 2012 4:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Jul 14, 2012 8:16 am    Post subject: Reply with quote

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
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 -> Documentation 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