Calendar Module: List showing incorrect order
-
- Power Poster
- Posts: 322
- Joined: Sat Feb 04, 2006 1:24 am
- Location: London, England
Calendar Module: List showing incorrect order
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.
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.
Last edited by stopsatgreen on Wed Aug 30, 2006 10:06 pm, edited 1 time in total.
-
- Power Poster
- Posts: 322
- Joined: Sat Feb 04, 2006 1:24 am
- Location: London, England
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Calendar Module: List showing incorrect order
can you tell me what you category tag looks like ?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
- Power Poster
- Posts: 322
- Joined: Sat Feb 04, 2006 1:24 am
- Location: London, England
Re: Calendar Module: List showing incorrect order
{cms_module module="Calendar" display="list"}
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Calendar Module: List showing incorrect order
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.
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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
-
- Power Poster
- Posts: 322
- Joined: Sat Feb 04, 2006 1:24 am
- Location: London, England
Re: Calendar Module: List showing incorrect order
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]
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
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
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?
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.*
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
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?
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
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?
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
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
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
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.
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
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.
See here
You will see the May dates are showing in August.
Any suggestions or help is appreciated.