We have a Matrix that has a simple text input in the first column, and another text input in the second column. First column is for a link title, second column is for a URL. This is the stripped down code we're using to display this information on the template, showing the title if there is one:
{if "{link_field:total_rows}" >= 1}
<h4>{title} Links</h4>
<ul>{link_field}
<li>
<a href="{link_url}">{if link_title}{link_title}{if:else}{link_url}{/if}</a>
</li>
{/link_field}</ul>
{/if}
Very simple: if there are any rows, output the h4, open a UL, loop through the rows (outputting a title if there is one, otherwise outputting the URL), close the UL, done.
The issue is that the simple "if" conditional is breaking things, especially if there is any text in the first column that resembles user-related global variables (email, screen_name, username). Those are actually getting parsed - even though there are no braces.
For example, a link title might read "Send email to user-selected recipient". The 'email' there is getting parsed (and getting double quotes added) so the field reads (using my email address): "Send "[email protected]" to user-selected recipient". That being the case, it's going into the {if link_title} conditional statement and breaking, so that the template returns a parse error:
Parse error: syntax error, unexpected T_STRING in /.../system/expressionengine/libraries/Functions.php(680) : eval()'d code on line 649
If we just output {link_title} outside of a conditional, it outputs the text in the field as I'd expect. Another odd thing we notice is that if we put a plus sign "+" in the first column, the template breaks as well.
Doesn't seem to make a difference how we do that conditional:
{if link_title}
{if link_title != ''}
{if "{link_title}"}
{if "{link_title}" != ''}
Has anyone run into this? This site is on EE 2.5.2. We just updated and tested with latest version of Matrix (2.5.3), so the add-on version doesn't seem to matter.