Page 1 of 1

CGCalendar, upcominglist, and unique_only

Posted: Tue Feb 23, 2010 10:15 pm
by jonnypage
CGCalendar 1.2.5
CGExtensions 1.17.6
CMS Made Simple 1.6.6 "Bonde"

Hey, I've been searching for this all day, and only find things that are close.. so here we go.

I'm making a calendar with upcominglist, and I have a few items that repeat every week, so have generated child events for them.  When I use my template normally, they all show up, from most recent to furthest away.  When I add unique_only - only the last date item (sometime in 2015) is shown, not the most current one.

Is there a way to make it show the most recent event in a series, and not the last one, while still using unique_only?

Re: CGCalendar, upcominglist, and unique_only

Posted: Fri Feb 26, 2010 9:05 pm
by jonnypage
I found that if I removed all the child events manually (checking the boxes to delete) then add them again in the parent, that it works like it should. Anyone have any idea why I have to delete the first set of child events?

Re: CGCalendar, upcominglist, and unique_only

Posted: Sat May 01, 2010 8:19 am
by jonnypage
anyone? I am still having this problem in 1.5.2. The last child event date shows, and not the next one.

ie: date shows dec 30, 2010, when the calendar is set to repeat every thursday from jan 7, 2010 to dec 30, 2010. It will not show the next thursday in the cycle.

Sometimes when I delete and remake the child events it will show a random date, like may or september. Weird.

Re: CGCalendar, upcominglist, and unique_only

Posted: Sat May 01, 2010 10:43 pm
by Dr.CSS
You have all the latest versions of these modules?...

If so you may want to file a Bug Report in the modules forge page...

Re: CGCalendar, upcominglist, and unique_only

Posted: Tue Apr 12, 2011 4:31 pm
by SESTH
Hi,

I have a similar problem with CMS-Version 1.9.2, CGExtensions 1.24.2 and CGCalendar 1.5.7. When I try to show upcoming events I would expect to get the next event for each title. But the result seems to depend on the order of events in the database. With unique only settings the following sample query is generated:

Code: Select all

SELECT cms_module_cgcalendar_events.* FROM cms_module_cgcalendar_events WHERE (cms_module_cgcalendar_events.event_date_start >= '2011-04-12 18:06:07' OR (cms_module_cgcalendar_events.event_date_end >= '2011-04-12 18:06:07' AND COALESCE(cms_module_cgcalendar_events.event_date_end,'0000-00-00 00:00:00') != '0000-00-00 00:00:00')) GROUP BY cms_module_cgcalendar_events.event_title ORDER BY cms_module_cgcalendar_events.event_date_start ASC
GROUP BY first operates on unsorted data and returns the first found record for each title and then the remaining records are sorted. There is no guarantee to get the first upcoming event for each title.

Re: CGCalendar, upcominglist, and unique_only

Posted: Tue Apr 12, 2011 5:48 pm
by M@rtijn
And?
Is there a question to this post?

Have you tried unique_only='0' to get all the events?

Re: CGCalendar, upcominglist, and unique_only

Posted: Tue Apr 12, 2011 6:19 pm
by SESTH
Not a question but a possible explanation for the behavior.

With unique_only='0' you won't run into this problem ;) because the above GROUP BY clause is omitted then.

It might be a bug - but I haven't found a description that unique_only should return the most nearest event from now.

Re: CGCalendar, upcominglist, and unique_only

Posted: Tue Apr 12, 2011 6:33 pm
by M@rtijn
Yes, the behaviour is known.

Bugs shouldn't be reported through the forum, we have the Forge for that.