Support

Home Forums Event Espresso Premium Recurring Events with multiple dates are splitting off into seperate listings

Recurring Events with multiple dates are splitting off into seperate listings

Posted: June 20, 2014 at 3:44 pm

Viewing 12 reply threads


Dustin White

June 20, 2014 at 3:44 pm

On our template that we’re using we have it set to display a dropdown list of dates for recurring events with multiple dates. I can provide a link if necessary.
Event Espresso version 3.1.36.5.P
WordPress version WP 3.9.1

Here’s a screenshot to show what I mean:

The event on top is also part of the recurring series of events, but it is not being grouped with the multiple dates for the other two dates (see expanded screenshot)

Please let me know what additional information you think would be required here. I have put the associated template into a pastebin
http://pastebin.com/UG5ZeBew


Dean

June 23, 2014 at 1:08 am

Hi Dustin,

Could you post the image again please as it didn’t come through (using a thirdparty image hosting site might be better).

Was this recurring event modified after creation to add in more dates?


Dustin White

June 23, 2014 at 7:33 am

Yes it was modified after creation to add more dates, ideally this would just add a date to our listing, see screenshots below.

I’ll just link to screenshots instead of embedding:
http://puu.sh/9GxMs/4e9e63e9f5.png these two events should not be split apart, rather all dates should be available underneath the multiple dates listing which expands to look like this:
http://puu.sh/9GxQ6/dee23ec60d.png

Thanks,


Josh

  • Support Staff

June 23, 2014 at 8:42 pm

Hi Dustin,

The code that’s handling the query that’s likely affecting this is most likely in event-list.php.

You could look for an GROUP BY clause and make sure it’s grouping by the recurring event ID and also the ORDER BY clause and make sure it’s ordering by the recurrence ID first, then the date.

You might also find the example reference templates included inside the REM plugin helpful if you compare their code to what you have.


Dustin White

June 24, 2014 at 9:53 am

After a lot of testing I’m still getting issues after following your instructions

I’ve changed the sql to the following, but it still is splitting off the 4th date for one reason or another.

<code>$sql .= $show_recurrence == &#039;false&#039; ? &quot; AND e.recurrence_id = &#039;0&#039; &quot; : &#039;&#039;;
		$sql .= &quot; GROUP BY e.id &quot;;
		//this bit broke up the recurring events ticket #539
		$sql .= $order_by != &#039;NULL&#039; ? &quot; ORDER BY &quot; . $order_by . &quot; ASC &quot; : &quot; ORDER BY recurrence_id,date(start_date) ASC &quot;;
		$sql .= $limit &gt; 0 ? &#039; LIMIT 0, &#039;.$limit : &#039;&#039;; </code>

I also tried fully overwriting the template with this:
https://gist.githubusercontent.com/joshfeck/3165268/raw/fc8fae81124d62d0158eaf6a24e2bb31f08169e7/event_list.php

also with no luck, it just moves the event in question to the bottom list but one of the dates still gets split off


Dustin White

June 24, 2014 at 9:54 am

The code tag didn’t seem to work very well so here’s a pastebin instead
http://pastebin.com/75WhFxq9


Josh

  • Support Staff

June 24, 2014 at 10:57 am

Hi Dustin,

Can you look in the database (using something like PHPmyadmin) at the _events_detail table for the event that’s getting split off and make sure that it has the same recurrence ID as the others?


Dustin White

June 24, 2014 at 12:01 pm

Yes, all 4 events have the same recurrence_id.


Tony

  • Support Staff

June 25, 2014 at 3:42 am

Hi Dustin,

Within the last pastebin you posted is this line:

$sql .= ' GROUP BY e.id ';

change that to

$sql .= ' GROUP BY e.recurrence_id, e.id ';

That should group the events by the recurrence_id and then the id.


Dustin White

June 25, 2014 at 8:41 am

I tried your change with no luck, the last event in the series is still splitting off
http://puu.sh/9JuzV/b2e29db4d5.png


Dustin White

June 27, 2014 at 9:47 am

Any other updates on this, or any further information you need from me to help solve this problem? Seems to be an issue somewhere in the database but it doesn’t make any sense to me since everything looks correct.


Josh

  • Support Staff

June 27, 2014 at 10:10 am

Hi Dustin,

I think this is an issue with your custom code. Can you try using the recurring event templates that are included with the REM plugin instead to see what they do.

Also, can you check the shortcode on the page? Is it [EVENT_LIST] or something else?


Dustin White

June 27, 2014 at 4:26 pm

Using the event_list template that is included by default didn’t help. I managed to stop it from happening for now by doing some debugging and deleting past events that were sneaking their way into the query results (the query results from the template were not following the order by clause properly, but in the database the same query that was executed was behaving properly. Makes no sense to me…). I’ll mark this as closed for now, its frustrating but at least we have a solution.

Thank you all for your help.

Viewing 12 reply threads

The support post ‘Recurring Events with multiple dates are splitting off into seperate listings’ 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