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

Smarty 3 SmartyCompilerException on single quote

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


Joined: 22 Feb 2013
Posts: 20

PostPosted: Fri May 17, 2013 7:13 pm    Post subject: Smarty 3 SmartyCompilerException on single quote Reply with quote

I am upgrading from smarty 2 to smarty 3 and I am running into a strange problem. It seems like Smarty 3 does not like single quotes.

For example I have this line of javascript wrapped with {literal}
Code:

var apPayeesDropdownValues   = $("#ap_payees_dropdown").val().split('_');

and I get this error
Code:

[17-May-2013 12:58:09 America/Denver] PHP Fatal error:  Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "\Interfaces\Templates\accounting\invoices\create_invoice.tpl"  on line 478 "var apPayeesDropdownValues = $("#ap_payees_dropdown").val().split('_');"  - Unexpected "'}


If I change the single quotes to double quotes then the error goes away for this line and shows up for the next line that has single quotes.

Why would smarty be freaking out about single quotes in javascript when I am using {literal}?
Back to top
View user's profile Send private message
ryanmc
Smarty Rookie


Joined: 22 Feb 2013
Posts: 20

PostPosted: Fri May 17, 2013 8:10 pm    Post subject: Reply with quote

Nevermind I found the problem. Their was an extra single quote further up in the code, once I removed it the error went away.
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 Development 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