2

The upgrade we did last night from 2.8.1. to 2.9 seemed OK. However we only tested the back-end so far!

While running the front-end we're getting these errors messages on all pages…

Error

You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}.

Lexer State: if: is a reserved prefix.

Of course we're focussed on finding incorrect conditional errors and couldn't find any! Checked 50+ templates. Close to giving up we found the issues caused by a missing } in a script in our HTML footer…..

2
  • 1
    Yes the syntax seems more strictly enforced...I've found a number of missing } and / in my code, even an entirely missing {/if}. I just remove big chunks from my template to quickly narrow it down to smaller areas...it's usually not hard from there. Commented Jul 17, 2014 at 8:21
  • Please, move the answer to a proper answer and mark it as right.
    – Sobral
    Commented Jul 17, 2014 at 12:08

2 Answers 2

1

Yes the syntax seems more strictly enforced...I've found a number of missing } and / in my code, even an entirely missing {/if}. I just remove big chunks from my template to quickly narrow it down to smaller areas...it's usually not hard from there.

(move to answer as per Robson)

1
  • i use indentation in template files and a customised ExpressionEngine syntax highlighter (Sublime Text editor) That helps a lot for reviewing code (incorrect tags not coloured)
    – GDmac
    Commented Sep 27, 2014 at 13:23
0

I also found this case:

{exp:channel:entries channel="resources" status="open" url_title="{last_segment}" limit="1" disable="member_data|trackbacks|pagination" track_views="one"}
{exp:ifelse parse="inward"}
     {if xxx}


     {/if}
{/exp:channel:entries}
{/exp:ifelse}

did not work, but

{exp:channel:entries channel="resources" status="open" url_title="{last_segment}" limit="1" disable="member_data|trackbacks|pagination" track_views="one"}
{exp:ifelse parse="inward"}

     {if xxx}

     {/if} 

{/exp:ifelse}
{/exp:channel:entries}

did. Note the order of the channel entries tag and the closing IfElse tag in relation to the opening tags.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.