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

Support archive

show_active="no" attribute does not seem to work

Stoyan Vasilev 28 Oct 2013 21:15 problem, complete

Hi,

In one of our websites the show_active="no" attribute does not seem to work. The site renders events which started before the current date/time. The tag looks like this:

{exp:low_events:entries channel="exhibitions" show_active="no" show_upcoming="yes" show_future_entries="yes"}
{s_exhibitions_exhibition}
{/exp:low_events:entries}

We have multiple low events fields in this channel and the main one has "Overwrite entry and expiration dates" set to Yes.

Is there anything that we can/should check? If not should I make you a username so you can have a look?

Thanks.

Replies

  1. Low 29 Oct 2013 08:24

    What do you mean with "multiple Low Events fields in this channel"? Have you added the field multiple times to a single field group so a channel entry has more than one LE field?

    One thing to check is that the server time (which LE uses) is the same as your time. If in your time an event has passed, it might not have in server time.

    And just to be sure; an 'active' event is an event that has a start date in the past and an end date in the future.

  2. Stoyan Vasilev 30 Oct 2013 23:43

    // What do you mean with "multiple Low Events fields in this channel"? Have you added the field multiple times to a single field group so a channel entry has more than one LE field?

    We have a field called cf_events_dates and another one called cf_events_reception and then a third one called cf_events_custom. All three are low events fields.

    Which PHP var in info is the server time?

    Yes, this is what I mean by active.

  3. Low 31 Oct 2013 09:02

    That might be the problem. LE doesn't know which field to target. Try this:

    - Open up mod.low_events.php
    - Uncomment (remove double slashes on)line #206, so it reads:

    $this->_events_field_filter();


    - Save the file
    - Add events_field="cf_events_dates" to the Entries tag

    Does that help?

  4. Low 31 Oct 2013 09:10

    The server time can be seen if you echo out this in a php file:

    date('Y-m-d H:i');

  5. Stoyan Vasilev 6 Nov 2013 19:44

    Hi,

    Uncommenting line 206 and adding the field attribute makes the template work but it introduces another problem:

    When the tag in question repeats twice on the page I get this error:

     
    Error Number: 1054
    Unknown column 'field_id' in 'where clause'
    SELECT 'm_field_id', 'm_field_name', 'm_field_fmt' FROM ('exp_member_fields') WHERE 'field_id' IN (18)
    Filename: modules/channel/mod.channel.php
    Line Number: 425

    When I comment out one of the instances everything works.

    The template code which needs to repeat twice is:
    {exp:low_events:entries  
    channel="exhibitions"
    show_passed="no"
    events_field="cf_exhibitions_dates"}
    {if count == 1}
    <ul class="links alt">
    {/if}
    <li><a href="{title_permalink="exhibitions"}">{title}</a></li>
    {if count == total_results}
    </ul>
    {/if}
    {/exp:low_events:entries}


    This is on my local MAMP PRO copy and the system time is the same as my OS X time.

  6. Low 6 Nov 2013 20:05

    Yeah, that's why the line was commented out. Try and uncomment line 307 as well. That should help get that error away, while I think of a more constructive solution.

  7. Stoyan Vasilev 6 Nov 2013 20:07

    That worked. It's okay to leave it like when the site goes live?

  8. Low 6 Nov 2013 20:44

    Yeah, should be fine.

  9. Stoyan Vasilev 6 Nov 2013 20:56

    Kool. Thanks!