We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Events

Past events not showing

Hi

I'm using Perch events with the call;

<?php
                    perch_events_custom(array(
                        'past-events'=>true,
                        'filter'=>'eventDateTime',
                        'match'=>'gte',
                        'value'=>date('Y-m-d'),
                        'count'=>20,
                        'sort'=>'eventDateTime',
                        'sort-order'=>'desc',
                        'template'=>'listing/event-listing.html'
                    ));
                ?>

But past events are not showing showing. Here is the debug from the events index page;


Debug Message - Perch 3.0.10 [1] SELECT * FROM perch2_pages WHERE pagePath='/events/index.php' LIMIT 1 Fetching from cache: perch_events_event_categories9e158a0f6af6022286354fe52a539a46 Cache file not found: perch_events_event_categories9e158a0f6af6022286354fe52a539a46 [1] SELECT * FROM perch2_events WHERE eventSlug = '' [1] SELECT DISTINCT e.* FROM perch2_events e WHERE eventDateTime>='2017-09-19' ORDER BY eventDateTime ASC LIMIT 20 [33] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 [1] Using template: /templates/events/listing/event-listing.html [1] SELECT c.* FROM perch2_events_categories c, perch2_events_to_categories e2c WHERE c.categoryID=e2c.categoryID AND e2c.eventID='1' Missing variant. [4] SELECT SQL_CALC_FOUND_ROWS DISTINCT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch2_blog_index idx JOIN perch2_blog_posts main ON idx.itemID=main.postID AND idx.itemKey='postID' JOIN perch2_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='postID' AND idx2.indexKey='postDateTime' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, postID ) as tbl WHERE (postStatus='Published' AND postDateTime<='2017-09-19 14:49:00' ) GROUP BY itemID, sortval ORDER BY sortval DESC LIMIT 0, 4 [1] SELECT FOUND_ROWS() AS `count` [4] Using template: /templates/blog/post_feed.html [1] SELECT * FROM perch2_blog_sections ORDER BY sectionTitle ASC [1] SELECT * FROM perch2_blogs ORDER BY blogTitle ASC

Here is my diagnostics report;

Perch: 3.0.10, PHP: 5.4.45, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (3.0.10), assets (3.0.10), categories (3.0.10), perch_blog (5.5.1), perch_events (1.9.5)
App runtimes: <?php $apps_list = array( 'perch_blog', 'perch_events', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/lacepartners/public_html/perch
PERCH_CORE: /home/lacepartners/public_html/perch/core
PERCH_RESFILEPATH: /home/lacepartners/public_html/perch/resources
Image manipulation: GD
PHP limits: Max upload 25M, Max POST 128M, Memory: 256M, Total max file upload: 25M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/lacepartners/public_html
HTTP_HOST: www.lacepartners.co.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Wayne Hooper

Wayne Hooper 6 points

  • 3 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You are filtering for dates gte (greater than or equal to) today, so past events won't show up.

Oh, yeah. Missed that. Removed match, value and filter. All works now. Thanks.