We just did an upgrade on a client site from 1.6 right through to 1.7 and suddenly discovered that all conditional statements which used embedded variables passed from a parent template which were ‘within’ a weblog entries loop no longer work as expected. In fact they no longer work at all.
We’ve verified that something has changed by executing the some simplified templates that demonstrate this on the upgraded site and then again on another EE1 site we run that’s at v1.6.6.
Here’s a simple example: (parent template)
{embed="sandbox/.inc_grains_of_sand" myvar="can you hear me?"}And the child embed: (.inc_grains_of_sand)
{if embed:myvar=="can you hear me?"}Yes! I can hear you!{if:else}Did you say something?{/if}
{exp:weblog:entries weblog="articles" limit="1"}
{if embed:myvar=="can you hear me?"}Yes, I can hear you!{/if}
{if embed:myvar=="can you hear me?"}Yes, I can hear you!{if:else}Did you say something?{/if}
{/exp:weblog:entries}}With our upgraded site running 1.7 the final conditional statement fails and returns ‘Did you say something?’, in 1.6.6 on another site the same template correctly evaluates all the conditional statements and returns ‘Yes, I can hear you!’ for the final statement as expected.
We’ve engineered a workaround for this using segment variables but it gives us much less flexibility so it’s far from ideal. Is anyone aware of an intentional change to the parsing behaviour for embedded variables when inside a weblog entries loop and if so can you confirm which build this change first manifested itself in?