ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

White Screen of Death: Conditionals in 2.5.x

June 04, 2012 10:10am

Subscribe [3]
  • #1 / Jun 04, 2012 10:10am

    ira42

    167 posts

    Just upgraded from EE 2.4 to 2.5.1,  and am now getting random whitescreens of death on certain pages on my site.

    Turning off “GZip Compression”  reveals php errors,  all having to do with Conditionals in my templates,  but not in any particularly consistent way.

    Has anything changed in EE 2.5.x with regards to parsing conditional statements,  and if so,  are there any upgrade notes regarding this that I’ve missed? 

    A simple point upgrade shouldn’t take down my entire site,  and require me to hunt through thousands of lines of template code,  hoping to find what EE doesn’t like all of a sudden…

  • #2 / Jun 04, 2012 2:55pm

    ira42

    167 posts

    *bump*

    Any news?

  • #3 / Jun 05, 2012 11:27am

    Shane Eckert

    7174 posts

    Hello ira42,

    I have not seen any other threads on this topic.

    I tried to reproduce this, but I am unable to do so.

    Can you list out your Add-Ons for me?

    Would you mind showing me a few of the errors?

    Thank you,

  • #4 / Jun 05, 2012 12:09pm

    ira42

    167 posts

    Hi Shane,

    This is not add-on related,  so I won’t list all of mine here…  I’ve been able to repro this (and others have mentioned conditional troubles in 2.5.1 on Twitter as well…).

    On my local MAMP test installs,  the following conditional works on a clean 2.4.0 install,  but not 2.5.1:

    {exp:channel:entries limit="1" status="not Closed" disable="member_data|trackbacks|pagination"}
     {if "{entry_date format='%Y'}" != "{expiration_date format='%Y'}"}
      trace…<br>
     {/if}
    {/exp:channel:entries}

    The issue seems to be related to the single / double quote combinations.  On 2.5.1,  I get the following error (note the double quotes in the error message):

    A PHP Error was encountered
    Severity: User Warning
    Message: Invalid EE Conditional Variable: {if "{entry_date format="%Y"}
    Filename: libraries/Functions.php
    Line Number: 2843

    It’s odd that there are double quotes on both elements in the error,  no?  Like 2.5.1 is trying to sanitize the quotes?  The following code works in both 2.4.0 and 2.5.1 without the error:

    {exp:channel:entries limit="1" status="not Closed" disable="member_data|trackbacks|pagination"}
     {if '{entry_date format="%Y"}' != "{expiration_date format='%Y'}"}
      trace…<br>
     {/if}
    {/exp:channel:entries}

    Any ideas?

  • #5 / Jun 05, 2012 2:04pm

    Stephen T

    127 posts

    I’m seeing similar issues with conditionals in EE 2.5.1.  For example, this code generates a PHP error:

    {if "{event_first_date format='%Y%m%d'}" != "{event_last_date format='%Y%m%d'}"}

    But this code does not:

    {if "{event_first_date format="%Y%m%d"}" != "{event_last_date format='%Y%m%d'}"}

    Note that the only difference is the use of double quotes around the first date format.  The PHP error I’m getting is:

    A PHP Error was encountered
    Severity: User Warning
    Message: Invalid EE Conditional Variable: {if "{event_first_date format="%Y%m%d"}
    Filename: libraries/Functions.php
    Line Number: 2843

    These have worked previously on EE 2.4.

  • #6 / Jun 06, 2012 4:32pm

    Shane Eckert

    7174 posts

    Hey guys,

    Thanks for your patience on this. I was able to reproduce with your code. Thank you for providing that.

    I have filed a bug and marked it as a show-stopper.

    Please comment on the bug to stay up to date on it’s progress.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases