Page 1 of 1

Uncaught Twig_Error_Syntax: Unexpected character Oc 3.0.2

Posted: Tue Jan 16, 2018 1:38 am
by pm-netti
Hi
I am doing extension, json script do error in link.

Code: Select all

Fatal error: Uncaught Twig_Error_Syntax: Unexpected character "#" in "extension/shipping/new_extesion.twig"  at line 208. in C:\MAMP\htdocs\3020\system\library\template\Twig\Lexer.php:284 
This line 208 is:

Code: Select all

 <td class="text-left"><button type="button" onclick="$('#weight-value-row-{{ key }}-{{ weight_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
Problem is this:

Code: Select all

$('#weight-value-row
What is this issue?

Peku

Re: Uncaught Twig_Error_Syntax: Unexpected character Oc 3.0.2

Posted: Tue Jan 16, 2018 1:52 am
by pm-netti
Ps. Regex Lexer.php in line 44:

Code: Select all

 const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As';
why this line 273

Code: Select all

 elseif (preg_match(self::REGEX_STRING, $this->code, $match, null, $this->cursor)) {
            $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1)));
            $this->moveCursor($match[0]);
 }
is not found character "#"?

Re: Uncaught Twig_Error_Syntax: Unexpected character Oc 3.0.2

Posted: Tue Jan 16, 2018 6:17 am
by straightlight
Please post your new_extension.twig file as a ZIP attachment file.

Re: Uncaught Twig_Error_Syntax: Unexpected character Oc 3.0.2

Posted: Tue Jan 16, 2018 2:54 pm
by pm-netti
straightlight wrote:
Tue Jan 16, 2018 6:17 am
Please post your new_extension.twig file as a ZIP attachment file.
Why?
Code from line 208 is this:

Code: Select all

<td class="text-left"><button type="button" onclick="$('#weight-value-row-{{ key }}-{{ weight_row }}').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
Upside down :)
banner_form.twig line 83, why this is work:

Code: Select all

 <td class="text-left"><button type="button" onclick="$('#image-row{{ image_row }}, .tooltip').remove();" data-toggle="tooltip" title="{{ button_remove }}" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>

Re: Uncaught Twig_Error_Syntax: Unexpected character Oc 3.0.2

Posted: Wed Jan 17, 2018 5:36 am
by pm-netti
Solved ;D
Line 165 was error:

shipping[minimum_size].height was shipping[minimum_siz].height, missing character 'e'.

Strange. Twing find issue quite the wrong place :choke: