All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Problem with DropDate and Conditional (set to early parsing)

Brendan Underwood 23 May 2012 09:57 problem, complete

I have a problem with a conditional I'm using to test for date. I'm using Low Variables 2.2.1 along with the DropDate addon (although the problem persists when I change to a text input with the same integer).

entry open {control_entry_open}, current_time {current_time format="%Y%m%d"}

will render out as:

entry open 20120604, current_time 20120523

My actual condition though which works if I hardcode the above dates does not work.

{if '{control_entry_open}' > '{current_time format="%Y%m%d"}'} show {if:else} don't show {/if}

Variations with/without statements and quotes give a similar problem.

Any ideas what could be causing the problem?

Replies

  1. Brendan Underwood 23 May 2012 10:03

    {if 20120604 > 20120523} show {if:else} don't show {/if}

    returns the correct intended outcome - 'show'.

    as does

    {if '20120604' > '20120523'} show {if:else} don't show {/if}

  2. Low 23 May 2012 10:18

    Can't seem to reproduce. What are the settings for the DropDate var type? Are you sure it is saving the date as YYYYMMDD?

  3. Low 23 May 2012 10:21

    Looks like it is, eh? Can I get access to the CP, perhaps? Maybe it's environmental.

  4. Brendan Underwood 23 May 2012 10:28

    CP details sent.

  5. Low 23 May 2012 10:41

    Hey Brendan,

    The early parsed vars weren't getting added to the Snippets array, because a hook was missing in the exp_extensions table. Somehow, it must have slipped through the upgrade process from EE1 to EE2.

    Anyway, I added the hook to the DB, so now it works again.

  6. Brendan Underwood 23 May 2012 11:18

    Cool, thanks very much for the quick support. I did honestly think I was going mad.

  7. Brendan Underwood 4 Jun 2012 12:36

    Hi Low, sorry but having some problems with DropDate addon again. Although I'm able to use the variable name itself {control_entry_open} fine, as soon as I add in a format parameter, it just renders the tag code itself, not the formatted date. e.g.

    {control_entry_open format="%l, %j %F %Y at %g:%i%A"}

    or

    {control_entry_open format="%Y"}

    Any ideas why it's not working? Note that I've switched between using the UNIX Timestamp and YYYYMMDD format on how the variable stores the data.

  8. Low 4 Jun 2012 12:38

    Snippets/Global variables can't have parameters, so you'd have to use the template tag instead:

    {exp:low_variables:single var="control_entry_open" format="%Y"}

  9. Brendan Underwood 13 Jun 2012 12:57

    Low, wondering if the problem with my disappearing hooks on the web awards website could have been caused by Profile:Edit. Using on another website where saving the P:E settings blows away one of the hooks out of exp_extensions table.

    http://mightybigrobot.com/forums/view...

  10. Brendan Underwood 13 Jun 2012 13:23

    And now Rob has provided a fix too.

  11. Low 13 Jun 2012 13:31

    Ah, good to hear!