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

Support archive

Discrepancy between events visibility on dev vs production; misunderstanding template tags?

Daniel Howells 2 Mar 2016 11:46 problem, complete

I'm struggling with a situation with Low Events where events on my dev environment and production are out of sync, even though the the server settings are - as far as I can tell - the same.

On my production server, an event that has past is being shown as current *and* future (http://cl.ly/fIT0) while it's not showing at all on my dev server, not even in past events (http://cl.ly/fJ1t). Perhaps I've misunderstood the template tags.

For Current Events (that are on *right now*):
{exp:low_events:entries channel="events" show_upcoming="no"}

For Future Events:
{exp:low_events:entries channel="events" unit="upcoming" show_active="no" show_passed="no"}

For Past Events:
{exp:low_events:entries channel="events" unit="passed" show_active="no" orderby="low_events:end" sort="desc" dynamic="no"}

This doesn't really explain the discrepancy between the two environments though: what does Low Events use as its time and date? My htaccess contains:

php_value date.timezone 'Europe/London'

and this is reported correctly in phpinfo(), along with the correct time in London.

Replies

  1. Daniel Howells 2 Mar 2016 12:14

    Few updates:

    Changed Future Events to this tag:

    {exp:low_events:entries channel="events" unit="upcoming" show_active="no" show_passed="no"}

    and Current Events to this tag:
    {exp:low_events:entries channel="events" unit="active"}

    Yet the event "On very soon" should now appear in "Current Events" since it is has started (have outputted {current_time} above) - http://cl.ly/fIhC

    And an event that finished at 12:01 should appear in Past Events doesn't appear at all using the same tags as my original message.

  2. Low 2 Mar 2016 13:44

    Since Low Events calculates its dates based on server time (not necessarily EE time), it's probably best to first determine if dev and production are indeed equal. You can check by creating a template with PHP enabled (input or output, doesn't matter) on both environments and add this to it:

    <?php echo strtotime('Y-m-d H:i:s'); ?>


    That will give you the current date and time for that particular server.

    You can also put that line in a single PHP file (eg. date.php) and upload that to both your dev and prod servers, and load up the file in your browser.

    If the date/time is different for both environments, then that would explain the differences between the two.

  3. Daniel Howells 2 Mar 2016 13:53

    I tried that, they're identical :-/

    Are the tags that's I'm using correct first of all?

  4. Low 2 Mar 2016 14:35

    The tags look right.

    Are you using Dynamic Query Caching https://docs.expressionengine.com/v2/... perhaps?

  5. Daniel Howells 2 Mar 2016 14:37

    Ah. :-)

    Didn't occur to me that could be the issue...!

  6. Low 2 Mar 2016 14:38

    That feature causes more trouble than it's worth, to be honest!

  7. Daniel Howells 2 Mar 2016 14:38

    Seems like it. I'll disable it.

  8. Low 2 Mar 2016 14:53

    Let me know if that indeed fixes the issue for you.