Posted: July 6, 2016 at 6:14 pm
I’m having an issue with this code:
It works, but not as it should. I have a custom script in the uploads/templates/espresso folder referenced here: https://gist.github.com/lorenzocaum/ac217033f12232404cce Custom code was added to display an All Tickets page. All Tickets SHOULD display ALL including expired. The issue is, it is only displaying expired events up to about a week ago. Today is July 6. It shows expired events up to June 28. There are many more than that, as we have been using Event Espresso since May 2016. I have tried renaming the file so that the original ESPRESSO_EVENTS_TABLE_TEMPLATE code gets called instead just to see if it was in the script from Lorenzo or if it was in Event Espresso core code. I noticed there was no change in restoring to the original code: It goes back to June 28 but nothing earlier than that is ever retrieved. Is it possible to retrieve ALL past/expired events ever created through the show_expired parameter? |
|
Yes, you set show_expired to true. |
|
Sorry Josh, the code was actually set to show_expired=true.
As I said, it is only going back to June 28. No events are displayed before that. Even when I restore the code back to the default EE4 template, it only returns everything from that date forward. |
|
One thing that could be happening is there are some invalid date times in those older events. A quick check to see if that may be the case would involve changing the sort attribute to be |
|
ASC has just reversed the order so that the first date is now June 28. However, where it usually shows me a date and time (ex: July 7, 2016 from 6:30 pm – 8:30 pm), it lists it like this for that particular event: There are no upcoming dates for this event. I tried to set it as a Draft and the list will then only show everything after June 28, and June 28 just isn’t shown. That particular event has a Start Date (June 28, 2016 11:00 am) and a Sale Date (June 23, 2016 11:36 am) so it doesn’t look like any dates are invalid. I would think EE4 had some measures in place to prevent that in its core. I tried re-selecting the dates and it has now disappeared. But that didn’t solve the problem of anything before July 7th. (Now the current date). |
|
You would think EE4 had some measures in place to prevent what? Have any other modifications been made to this installation? The reason I ask is because I’m having a bit of trouble with reproducing the issue you’ve reported. Here’s an example of one of testing sites that’s using the table template: |
|
No core code was altered. I don’t think I put anything in custom functions to alter the code. The code from Lorenzo is being used, however, upon removing that template, it shows the same database call, failing to actually show anything before today’s date. |
|
Hello, The custom template in the first example which shows all datetimes is no longer needed as there is now a parameter (show_all_datetimes) available for showing that information: [ESPRESSO_EVENTS_TABLE_TEMPLATE show_all_datetimes=TRUE] If your software is up to date, then you could use that parameter instead. You shared that you didn’t think that there was any custom functions in use. Could you double check to see if there is a site specific plugin running with some custom functions for Event Espresso or they could be in your child theme’s functions.php file if one is in use. — |
|
Thanks guys. It turns out I did have some code in the custom functions.php file that was preventing expired tickets from displaying. I disabled the functions.php and realized that the tickets were displaying. After going through the custom functions.php file, I found an experimental code in there that I was testing out. This non-issue is resolved. |
|
Thank you for letting us know, I’m glad you found the problem 🙂 I’ll mark this thread resolved. |
|
The support post ‘show_expired only going back a week’ 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.