Calendar Module: List showing incorrect order

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Calendar Module: List showing incorrect order

Post 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.
Last edited by stopsatgreen on Wed Aug 30, 2006 10:06 pm, edited 1 time in total.
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: Calendar Module: List showing incorrect order

Post by stopsatgreen »

(bump)
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Calendar Module: List showing incorrect order

Post by calguy1000 »

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.
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: Calendar Module: List showing incorrect order

Post by stopsatgreen »

{cms_module module="Calendar" display="list"}
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Calendar Module: List showing incorrect order

Post 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.
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.
stopsatgreen
Power Poster
Power Poster
Posts: 322
Joined: Sat Feb 04, 2006 1:24 am
Location: London, England

Re: Calendar Module: List showing incorrect order

Post 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]
PrezPenguin

Re: Calendar Module: List showing incorrect order

Post 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?
matthewb

Re: Calendar Module: List showing incorrect order

Post 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?
depiction
New Member
New Member
Posts: 4
Joined: Mon Jan 01, 2007 6:48 pm

Re: Calendar Module: List showing incorrect order

Post 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?
matthewb

Re: Calendar Module: List showing incorrect order

Post by matthewb »

Did you remove the whole of $sql = "SELECT DISTINCT $events_table_name.* or just the word DISTINCT? Should be the latter. HTH
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm
Location: Florida

Re: Calendar Module: List showing incorrect order

Post 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.
PrezPenguin

Re: Calendar Module: List showing incorrect order

Post 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.
ittsmee2
Forum Members
Forum Members
Posts: 23
Joined: Sat Nov 19, 2005 12:42 am

Re: Calendar Module: List showing incorrect order

Post 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.
Post Reply

Return to “Modules/Add-Ons”