Support

Home Forums Event Espresso Premium EE4 Issues with Order by Start Date & Displaying Expired Events

EE4 Issues with Order by Start Date & Displaying Expired Events

Posted: October 21, 2014 at 1:07 pm


Mike Wilson

October 21, 2014 at 1:07 pm

Hi,
WordPress 4.0
Event Espresso Version 4.4.3.p
Event Espresso – Calendar Version 3.1.0.p
Existing Installation updated on Friday, Oct 10
http://premierha.staging.wpengine.com/events/

Note: I am using the most recent Espresso_Arabica_2014 template files in my theme. I had to move things around a bit, but all of the pertinent code is in place. I have switched to Twenty Fourteen and the issues stated below persist.

1. Events (event list?? and category archives) are ordered by published date, rather than start date.

It looks like this behavior has changed somewhat. In previous versions the Event List was ordered by publish date, but now it seems they are ordering by start date by default, which is ultimately what I want. Can someone confirm this change in the new version or am I crazy??

That being said, event category archives are still ordered by publish date, which is weird. They should be ordered by start date as well.

It seems odd to me that ordering by start date is not the default behavior for everything… Publish date seems mostly irrelevant in the context of events, in my thinking.

How do I order the events in event category archives by start date, with the nearest event (e.g. active events or events happening today) at the top and events in the future at the bottom of the list?

2. Past events are not showing on the events list “page” (e.g. /events – not a physical page) even though the “Display Expired Events” setting is set to yes.

3. Past events in event archives (categories, etc.) display even though the “Display Expired Events” setting is set to no.

Ideal State

Ideally, what I want is a way to display a list of upcoming events from nearest to farthest and in a separate list (separate page?) display past events from most recently expired to oldest expired event. I want to be able to click on an event category in either list and see events ordered by start date near/far. Both lists should include pagination.

I thought about using shortcodes on pages, but the issue I face is I want more granular control over what is displayed/included in these lists (using get_template_part) and I can’t see any way to list -just- past events with a shortcode.

You can see an example of “kind of, sort of” what I’m looking for here – http://lanyrd.com/topics/uiux-1/

I don’t need the month grouping functionality, but more the general “upcoming” and “past” tab style functionality. I’m totally ok with these being on separate pages with a page reload e.g. /events and /events/past etc.


Lorenzo Orlando Caum

  • Support Staff

October 21, 2014 at 2:46 pm

Hi Mike,

Event Espresso uses the archive pages for WordPress. By default, these pages show content in reverse chronological order similar to a blog post.

We have since change it to order by start date for the event.

I ran some testing with the expired events toggle and it isn’t working as expected. I’ve created a report for the development team to review.

The event category are currently sorted by published date. I’ve also create an enhancement ticket to update the default sort order.

I’m not sure how to show only expired events but I’ll check with a team member and get back to you with more information.


Lorenzo


Mike Wilson

October 22, 2014 at 10:31 am

Thanks Lorenzo, I appreciate the effort and look forward to some resolution. 🙂


Lorenzo Orlando Caum

  • Support Staff

October 22, 2014 at 6:45 pm

Hi there Mike,

A team member created an example of how to display expired events. This example is for the Genesis theme and it can be tweaked for other themes:

https://gist.github.com/joshfeck/e2f6d67f981df6dc01f5

The bug report with the expired events is still in progress.


Lorenzo


Mike Wilson

October 24, 2014 at 12:55 pm

Hi,

Do you have an example of doing this in a non-Genesis theme? I’ve tried a couple of “tweaks” and am not getting any results.


Mike Wilson

October 24, 2014 at 1:23 pm

Hi,

Well now I seem to have it working somewhat, but it’s not exactly what I was expecting. I’m looking for a list of past events that looks and functions like the standard event list… but just expired events.

I’ve tried using the template parts from Espresso_Arabica_2014 to get the rest of the event details (thumbnail, header, datetimes, etc.) and some of it is working, and some of it not so much.

Also there is no pagination… I can’t just list an ever growing number of events on a single page.


Lorenzo Orlando Caum

  • Support Staff

October 24, 2014 at 3:18 pm

In the example, the limit is set to 100:

‘limit’ => 100,

Could you drop that to a lower value such as 10?


Lorenzo


Mike Wilson

October 24, 2014 at 6:40 pm

Hi,

I can and did exactly that but… regardless pagination doesn’t work. I passed in the paged query var, but it doesn’t seem to have any effect with this method.


Mike Wilson

October 27, 2014 at 8:56 pm

Hi,

I had a lot of difficulty accessing the support forums today. I was wondering if you’d made any progress on the past events toggle and the sort by start date issue for category archives? These issues are causing us problems in productions as our past events aren’t accessible at the moment and categories archives are a hot mess.

Also I managed to hack together a page template for only past events, but I still can’t get pagination working. We have hundreds of past events and I can’t put them all on one page, obviously. What do we need to do to hopefully move this along?

Thanks!


Josh

  • Support Staff

October 28, 2014 at 5:11 pm

Hi Mike,

I’m going to break things up in parts a bit. First, here’s an example of a “regular” page template that pulls in expired events, with pagination, that doesn’t involve using Genesis:

https://gist.github.com/joshfeck/56bc9e4a3683779fe90f#file-functions-php

A few notes: You’ll need to swap in your theme’s container divs because my example is likely not based on your WordPress theme. The container divs are commented at the top and bottom of the template (primary, main, and module).

I tried to add comments to help you see what does what, and in case you need to change things from the example it might make more sense.

You can also change the pagination to match your theme by copying the pagination markup from your theme’s archive template. You can also change the pagination options to meet your needs by using the information from the WordPress codex. The above example just has a copy from the example in the codex here:

http://codex.wordpress.org/Function_Reference/paginate_links


Josh

  • Support Staff

October 29, 2014 at 9:47 am

Going back to your initial post with items 1 & 3, your suggestions have been noted and a ticket to change the defaults has been filed with the dev team.

In the meantime while this gets worked out, you can add the code in this gist to a custom snippets plugin and it will re-order and exclude expired events from the event category archives:

https://gist.github.com/joshfeck/440bf1c01ede03458b3d


Josh

  • Support Staff

October 29, 2014 at 2:03 pm

Hi Mike,

The Answer to your Question about this template


if ( EE_Registry::instance()->CFG->template_settings->EED_Events_Archive->display_status_banner ) {
add_filter( 'the_title', array( 'EED_Events_Archive', 'the_title' ), 100, 2 );
}

Finally – what about the “show expired events toggle” issue? Is there any estimate when this will be fixed as well?

The issue is fixed and slated to be included in the 4.4.5.p release. I do not have an ETA for a release date for 4.4.5.p at this time.


Mike Wilson

October 30, 2014 at 2:15 pm

Hi Josh,

Thanks for helping with the filter, that worked perfectly. The additional patches you provided for category sorting and expired posts removal also worked nicely.

Do I need to be concerned this may cause conflicts when the actual fixes are added to EE4?

Thanks!


Josh

  • Support Staff

October 30, 2014 at 4:32 pm

What might cause a conflict, for what fix?


Mike Wilson

October 30, 2014 at 6:28 pm

I was told there was ticket in place to add sorting by start date to the event categories, so that’s the fix I’m speaking of.

The thing that kicked all of this off was I was using the a method recommended by you guys to sort my event list by start date. When you guys made start date the default sorting for the event list, it broke our event list… I had to remove our modifications to get it working again. The thing is I had no idea that had changed, so was totally unclear why things stopped working properly. Add to that the expired event toggle issues and everything was a hot mess in prod.

I just want to make sure that scenario won’t repeat itself with event categories.

Thanks!


Lorenzo Orlando Caum

  • Support Staff

October 31, 2014 at 10:07 am

Hi,

The patches that we provided will be included in 4.4.5. We provided those so you could move forward with your project.


Lorenzo


Josh

  • Support Staff

November 12, 2014 at 5:54 am

Hi there,

A little update on this: The fix for the issue with the Displayed expired events setting that you reported here is included in Event Espresso 4.4.5 which is available as an update now.


Josh

  • Support Staff

December 9, 2014 at 12:51 pm

Hi Mike,
I wanted to give you a little update on this: The issue you reported about the category archives is fixed in Event Espresso 4.4.6.p.


Mike Wilson

December 12, 2014 at 8:21 am

Hi,

Hi and thank you for the updates, unfortunately this has just caused more problems than it solved.

As of the 4.4.6p release

1. Categories are completely broken again now – I just get a “no events found” error message. Did something change in the templates that could be causing this? It was working fine in 4.4.5p. I really don’t want to have to update the templates unless I absolutely have to as it’s a manual pain.

2. If the “Display Expired Events” toggle is set to “no” so past events don’t display on the main Upcoming Events page, it breaks the page template that pulls in only expired events on the Past Events archive (the code you previously provided above). The only way I can show anything on the Past Events page is to toggle expired events “on”, which of course also displays them on Upcoming Events.

You can see things work fine here: https://www.premierinc.com/events/

And are totally broken here (4.4.6p): http://premierha.staging.wpengine.com/events/

All I did was update the plugin to 4.4.6p

Very frustrated with this process. Is it possible to contact someone directly to help us work through these issues?


Josh

  • Support Staff

December 12, 2014 at 9:08 am

Hi there,

I’m sorry for the trouble. While the fixes to the category archives fixed the original issues reported, it introduced some new bugs. There’s a developer working on a fix for the issues you reported, and once they are ready we’ll release a 4.4.7.p update. In the meantime if you’d like to go back to using Event Espresso 4.4.5.p, you can download a copy here:

Update: Event Espresso 4.4.7.p is available and fixes the issues reported here.

  • This reply was modified 9 years, 4 months ago by  Josh. Reason: update on status of 4.4.7.p


Mike Wilson

December 12, 2014 at 11:30 am

Hi and thanks for getting back to me… Obviously we can’t update production, so we’re staying on 4.4.5p for now.

What about the second point above… the broken past events code?


Josh

  • Support Staff

December 12, 2014 at 11:39 am

Is it broken in 4.4.5.p?


Mike Wilson

December 12, 2014 at 11:43 am

Hi,

No, just in 4.4.6p… Were you saying the fixes for the event category archives is what broke the code for my past events template?

I’m just going to roll staging back to 4.4.5p and wait for your next release and see where we are at that time.


Josh

  • Support Staff

December 12, 2014 at 1:39 pm

Right. The issues are with the expired events + 4.4.6.p. The fix for the category archives issue had the unintended effect of new adding new bugs for displaying expired events whether it be a single event or in an archive loop.


chrisscottuk

December 13, 2014 at 3:18 pm

Hi,

I’ve also had to roll back to 4.4.5 as the links to expired events are broken. People on the public site who click a link to event expired are met with a page not found message, and I get the same if I click on ‘view’ from with the EE4 admin.


Josh

  • Support Staff

December 17, 2014 at 12:33 pm

A little update on this: We are still working on a fix. It’s turning out to be a tricky one.


Josh

  • Support Staff

December 18, 2014 at 1:19 pm

The fix is available in Event Espresso 4.4.7.p, which was released today.


Mike Wilson

December 19, 2014 at 7:14 am

Thanks Josh! I will try to get this in our staging environment today and report back.


Dean

December 22, 2014 at 12:03 am

Hi,

Did you have any success with 4.4.7 on your staging server?

The support post ‘EE4 Issues with Order by Start Date & Displaying Expired Events’ 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