Support

Home Forums Event Espresso Premium Event Espresso – Events filter not working as expected

Event Espresso – Events filter not working as expected

Posted: February 5, 2020 at 8:46 pm


ndaniel

February 5, 2020 at 8:46 pm

When filtering events in Event Espresso – Events page by month/year, the events from 2019 no longer show in the results. it seems this behavior started when events starting in 2020 were added to the system.
What could be causing this behavior?
Thanks,
Bill


Tony

  • Support Staff

February 6, 2020 at 5:07 am

Hi Bill,

That’s not something I can reproduce.

So to clarify, is the dropdown still showing the dates but then filtered the events aren’t shown?

I’m assuming you can still see those events in the ‘all events’ list?


ndaniel

February 6, 2020 at 9:55 am

Hi Tony, your understanding is correct.
Let me know how you’d like to proceed in taking a closer look.
Thanks,
Bill


Tony

  • Support Staff

February 6, 2020 at 10:49 am

Hi Bill,

It could be a plugin conflict as I’m not able to reproduce on my test sites.

You can rule out a plugin/theme conflict using the WP Health Check Plugin.

Activate the plugin and to go Tools -> Site health -> Troubleshooting.

Enable troublehsooting mode and it will disable all plugins on your site and activate a default theme just for you as a logged in admin.

Then in the admin bar go to Troubleshooting Mode -> Manage active plugins.

Enable Event Espresso whilst in troubleshooting mode.

Now re-test, do you get the same issue?


ndaniel

February 6, 2020 at 8:27 pm

Hi Tony,
I disabled all plug-ins except EE during testing and get the same results.
Can you suggest a way I can capture logs for the page execution so get a deeper look?
Thanks


Tony

  • Support Staff

February 7, 2020 at 6:01 am

You can use Debug bar to check the queries:

https://developer.wordpress.org/plugins/developer-tools/debug-bar-and-add-ons/

Run the filter then open debug bar in the admin bar, go to Queries.

You’re looking for the query like this:

SELECT Event_CPT.ID AS 'Event_CPT.ID', Event_CPT.post_title AS 'Event_CPT.post_title', Event_CPT.post_content AS 'Event_CPT.post_content', Event_CPT.post_name AS 'Event_CPT.post_name', Event_CPT.post_date AS 'Event_CPT.post_date', Event_CPT.post_excerpt AS 'Event_CPT.post_excerpt', Event_CPT.post_modified AS 'Event_CPT.post_modified', Event_CPT.post_author AS 'Event_CPT.post_author', Event_CPT.post_parent AS 'Event_CPT.post_parent', Event_CPT.menu_order AS 'Event_CPT.menu_order', Event_CPT.post_status AS 'Event_CPT.post_status', Event_CPT.post_password AS 'Event_CPT.post_password', Event_CPT.comment_status AS 'Event_CPT.comment_status', Event_CPT.ping_status AS 'Event_CPT.ping_status', Event_Meta.EVT_display_desc AS 'Event_Meta.EVT_display_desc', Event_Meta.EVT_display_ticket_selector AS 'Event_Meta.EVT_display_ticket_selector', Event_Meta.EVT_visible_on AS 'Event_Meta.EVT_visible_on', Event_Meta.EVT_additional_limit AS 'Event_Meta.EVT_additional_limit', Event_Meta.EVT_default_registration_status AS 'Event_Meta.EVT_default_registration_status', Event_Meta.EVT_member_only AS 'Event_Meta.EVT_member_only', Event_Meta.EVT_phone AS 'Event_Meta.EVT_phone', Event_Meta.EVT_allow_overflow AS 'Event_Meta.EVT_allow_overflow', Event_Meta.EVT_timezone_string AS 'Event_Meta.EVT_timezone_string', Event_Meta.EVT_external_URL AS 'Event_Meta.EVT_external_URL', Event_Meta.EVT_donations AS 'Event_Meta.EVT_donations', Event_CPT.ID AS 'Event_CPT.ID', Event_Meta.EVTM_ID AS 'Event_Meta.EVTM_ID', Datetime.DTT_ID AS 'Datetime.DTT_ID', Datetime.EVT_ID AS 'Datetime.EVT_ID', Datetime.DTT_name AS 'Datetime.DTT_name', Datetime.DTT_description AS 'Datetime.DTT_description', Datetime.DTT_EVT_start AS 'Datetime.DTT_EVT_start', Datetime.DTT_EVT_end AS 'Datetime.DTT_EVT_end', Datetime.DTT_reg_limit AS 'Datetime.DTT_reg_limit', Datetime.DTT_sold AS 'Datetime.DTT_sold', Datetime.DTT_reserved AS 'Datetime.DTT_reserved', Datetime.DTT_is_primary AS 'Datetime.DTT_is_primary', Datetime.DTT_order AS 'Datetime.DTT_order', Datetime.DTT_parent AS 'Datetime.DTT_parent', Datetime.DTT_deleted AS 'Datetime.DTT_deleted' FROM wp_posts AS Event_CPT LEFT JOIN wp_esp_event_meta AS Event_Meta ON Event_CPT.ID = Event_Meta.EVT_ID LEFT JOIN wp_esp_datetime AS Datetime ON Datetime.EVT_ID=Event_CPT.ID WHERE Event_CPT.post_type = 'espresso_events' AND Event_CPT.post_status NOT IN ('auto-draft','trash') AND ( (Datetime.DTT_deleted = 0) OR Datetime.DTT_ID IS NULL) AND Datetime.DTT_EVT_start BETWEEN '2020-05-01 05:00:00' AND '2020-06-01 04:59:00' AND (Event_CPT.post_title LIKE '%%' OR Event_CPT.post_content LIKE '%%' OR Event_CPT.post_excerpt LIKE '%%') GROUP BY Event_CPT.ID ORDER BY Event_CPT.ID DESC LIMIT 0,10

Obviously your dates for the BETWEEN should match whatever you selected in the dropdown and clicked to filter.

Do you have the above or something different?


ndaniel

February 15, 2020 at 11:33 am

Hi Tony,
So, in the admin events screen, the event Month/Year filter shows December 2019.
The query being generated is for range December 2020. So this explains why the events don’t show. How can we get a fix?

snippet:
WHERE Event_CPT.post_type = ‘espresso_events’ AND Event_CPT.post_status NOT IN (‘auto-draft’,’trash’) AND ( (Datetime.DTT_deleted = 0) OR Datetime.DTT_ID IS NULL) AND Datetime.DTT_EVT_start BETWEEN ‘2020-12-01 07:00:00’ AND ‘2021-01-01 06:59:00’ AND (Event_CPT.post_title LIKE ‘%%’ OR Event_CPT.post_content LIKE ‘%%’ OR Event_CPT.post_excerpt LIKE ‘%%’) GROUP BY Event_CPT.ID ORDER BY Event_CPT.ID DESC LIMIT 0,20


Tony

  • Support Staff

February 17, 2020 at 3:21 am

Hmm, strange.

I’d like a take a look at this if possible?

If so you can send temp login details using this form:

https://eventespresso.com/send-login-details/


ndaniel

February 20, 2020 at 2:57 pm

Hi Tony,
login info sent. thanks!


Tony

  • Support Staff

February 21, 2020 at 6:31 am

Ok, so the dropdown itself is correct, selecting September 2019 on the dropdown sends ‘September 2019’ on the GET request as expected.

Can you enable SAVEQUERIES so I can view the queries using Debug bar?

Also, do you have any custom functions hooking into EE at all?

I can’t see anything obvious but then the code could be anywhere so is not always obvious.


ndaniel

February 22, 2020 at 8:29 am

Hi Tony,
Thanks for your time.
I’ve enabled savequeries. No custom functions have been hooked in.
Thanks,
Bill


Tony

  • Support Staff

February 24, 2020 at 5:11 am

Ok, so the problem is the date format in use on the site in Dashboard -> Settings -> General, you currently have F j meaning no year is used.

When EE applies that to the DateTime object for the query it uses the current year as one hasn’t been passed.

I’ve created a ticket to investigate this further on our end, in the meantime, if you switch to use F j, Y it will work as expected.


ndaniel

February 25, 2020 at 6:56 pm

Thanks for the research Tony. As this affects the date display across the site, we’d appreciate an update when a fix is available.
Regards,
Bill


Tony

  • Support Staff

February 26, 2020 at 8:59 am

Here is a fix that doesn’t involve changing the date format on the site:

https://gist.github.com/Pebblo/ddea6d317b20fa2e9f69c17792658399

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

As mentioned, we have a ticket to investigate/fix this within core (no ETA just yet) but the above can be used in the meantime.

The support post ‘Event Espresso – Events filter not working as expected’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso