I tried to upgrade Symfony to 4.4.17 and I got the above error for the line:
{% for lang, group in lang_groups if lang == from %}
This is the code. I have no idea how to fix this.
<div class="input-style">
<input type="text" name="query" value="{{ query|default('') }}" />
</div>
<div class="select-style">
<select name="lang_from">
{% for lang, group in lang_groups %}
<option value="{{ lang }}"{% if from == lang %} selected{% endif %}>{{ group.label }}</option>
{% endfor %}
</select>
</div>
<a href="javascript:void(0)" class="reverse-lang-pair" title="reverse language pair">⇄</a>
{% for lang, group in lang_groups if lang == from %}
<div class="select-style lang-group" data-lang="{{ lang }}">
<select name="{{ lang }}">
{% for lang_to, data in group.to %}
<option value="{{ lang_to }}"{% if to|default('') == lang_to %} selected{% endif %}>{{ data.label }}</option>
{% endfor %}
</select>
</div>
{% endfor %}