Page 1 of 1

Calendar Module: List showing incorrect order

Posted: Mon Aug 28, 2006 5:52 pm
by stopsatgreen
Hi,

I have version 0.7.1-svn of the Calendar module; when I display the List view in my page, it loops through each of the categories rather than displaying all the results in a single list; that is, it goes:

22/08 Category 1
29/08 Category 1
27/08 Category 2
Etc

Rather than:

22/08 Category 1
27/08 Category 2
29/08 Category 1

Any help gratefully received.

Re: Calendar Module: List showing incorrect order

Posted: Wed Aug 30, 2006 10:07 pm
by stopsatgreen
(bump)

Re: Calendar Module: List showing incorrect order

Posted: Wed Aug 30, 2006 11:53 pm
by calguy1000
can you tell me what you category tag looks like ?

Re: Calendar Module: List showing incorrect order

Posted: Thu Aug 31, 2006 12:08 am
by stopsatgreen
{cms_module module="Calendar" display="list"}

Re: Calendar Module: List showing incorrect order

Posted: Thu Aug 31, 2006 12:26 am
by calguy1000
Okay, I have two calendar categories each with the same sort weight (though I don't think the list mode listens to this anyways), two events each, and none has the same start date.

The calendar event list displayed on the frontend when I do a {cms_module module=Calendar display=list} is exactly the way I see them in the Calendar module admin.

And I double checked the code, and it's ordering by date.
seems to be working for me.

Re: Calendar Module: List showing incorrect order

Posted: Thu Aug 31, 2006 9:58 am
by stopsatgreen
In the Calendar module admin page, they are in the right order and all have the same Order value; yet in the page they display wrong:

http://217.112.82.95/~sunascou/index.php/art/calendar (or see the attached screenshot)

:(

[gelöscht durch Administrator]

Re: Calendar Module: List showing incorrect order

Posted: Mon Oct 30, 2006 5:31 am
by PrezPenguin
Hi, I'd just like to say that i encountered the same problem in the upcoming events list, but i found a workaround.

I browsed through my database and discovered that, for me, the upcoming events are not being displayed by category, but by the event_id.

I echoed the SQL query that the module puts out and tried it in phpMyAdmin. I couldn't even reorder the results of that query by clicking on the event_date_start field, but reordering the entire table by using a basic query was easy enough.

So, I edited line 38 of the function.displayupcominglist.php file in the calendar module folder

Code: Select all

 $sql = "SELECT DISTINCT $events_table_name.*
by removing the DISTINCT clause.
Everything seems to be working fine now. I can't help but wonder though, will I suffer any consequences for removing that?

Re: Calendar Module: List showing incorrect order

Posted: Thu Dec 21, 2006 5:50 pm
by matthewb
I found that problem occuring with one of my CMS sites, but not the other. They are on different webservers, so there may be an issue with different versions of php/mysql. I'm using still version 0.7 stable of Calendar and 0.13 of CMSMS.

Removing the DISTINCT command from the sql statement worked for me. Interestingly the same thing happened in phpmyadmin - with the distinct it came out in database order, but without it came out in date order. This will, I expect, cause a problem if the list is being displayed by category, and some events have more than one category selected.

Also, since there was no problem with the order in the admin view, I'm guessing (without hunting through the code) that the query there doesn't have the distinct.

I wonder if anyone has any thoughts on why this might be the presence of distinct would have this effect on the ordering on some servers but not others?

Re: Calendar Module: List showing incorrect order

Posted: Fri Jan 05, 2007 4:16 am
by depiction
I'm having this same problem, but removing  $sql = "SELECT DISTINCT $events_table_name.* didn't solve the problem for me.

I'm using Calendar v 0.7.6 and CMSMS version 1.0.2 "Maui".

Anyone have any ideas?

Re: Calendar Module: List showing incorrect order

Posted: Sat Jan 06, 2007 5:34 pm
by matthewb
Did you remove the whole of $sql = "SELECT DISTINCT $events_table_name.* or just the word DISTINCT? Should be the latter. HTH

Re: Calendar Module: List showing incorrect order

Posted: Tue Apr 03, 2007 5:17 am
by carasmo
function.displaylist.php is where the file is changed for month view. I couldn't find the word "distinct" in the file.upcomminglist.php.

Re: Calendar Module: List showing incorrect order

Posted: Tue Apr 24, 2007 2:05 pm
by PrezPenguin
It's been a while, I'm glad to see that I've helped some people.

Just to clarify, I was using:
CMSMS 1.0.2
Calendar 0.7.5

PHP 5.0.4
MySQL 4.1.21


But now, I have upgraded Calendar to 0.7.6, and i didn't re-modify the line of code.  The calendar events seem to be displaying in the correct order. I haven't done enough testing with the calendar database yet, but it could just be a lucky line of events.  I'll post here again if the problem comes back.

Re: Calendar Module: List showing incorrect order

Posted: Fri May 18, 2007 12:07 am
by ittsmee2
I am using the latest version and my dates are messed up as well.

See here

You will see the May dates are showing in August.

Any suggestions or help is appreciated.