Bug #5709

events list sorting screwed again

Added by mara over 2 years ago. Updated over 2 years ago.

Status:Closed Start:02/14/2009
Priority:Urgent Due date:
Assigned to:yossarian % Done:

0%

Category:Events
Target version:0.7 - Wookie Love Machine
Resolution:

fixed


Description

there's only featured events on https://london.indymedia.org.uk/events and the following pages seem in random order instead of chronological.

this seems to happen quite frequently. i've set it to urgent to sort it out, but might need a less urgent but more permanent fix?

History

Updated by mish over 2 years ago

Looks like the cache/sweeper thing might not be working for events - we could try deleting public/system/cache/events.html manually on london.indy. Seems to work ok on my dev set up.

Updated by mish over 2 years ago

Also I wonder if we should change the way events work. For me, when I click on the events tab, the view I would want most is the month view - /events/calendar_month - currently /events shows new events, but not repeated events ...

In fact most views seem a bit broken, apart from the month view. For example compare

http://london.indymedia.org.uk/events/calendar_month?date=2009-05-01
http://london.indymedia.org.uk/events/list_by_month?date=2009-05-01
These two seem fine

http://london.indymedia.org.uk/events/list_by_week?date=2009-05-18
This seems to have the events required, but the date starts again in the middle

http://london.indymedia.org.uk/events/list_by_day?date=2009-05-24
This has no events, despite events being listed on this day in other views.

Maybe time to attack the whole lot ...

Updated by mish over 2 years ago

Oh yeah, and then the /events/archives/x pages can just show all events, but they are not the main view, so won't confuse people.

Updated by yossarian over 2 years ago

  • Target version changed from 0.6 - post-launch cleanup to 0.7 - Wookie Love Machine

Updated by yossarian over 2 years ago

The fact that the events list sometimes contains only featured events is just a stupid mistake, but one which isn't obvious until you think about the events_controller a bit.

The index action currently looks like this:

  def index
    @cloud = Tag.cloud(:limit => 20)

    if params[:moderation_status].blank?
      @content = Event.visible.upcoming.paginate(:order => 'date ASC', :page => page_param)
    else
      @content = model_class.paginate(
        :conditions => ['moderation_status = ? and date >=?', params[:moderation_status], Date.today.to_s],
        :order => 'date ASC',
        :page => page_param)
    end
  end

Basically, the index action can take a params[:moderation_status], and it'll respond by grabbing the correct statuses for list_promoted, list_featured, or / (nothing). The caches_page directive in the ContentController superclass tells the controller to cache the index action when it's first viewed. So, if the cache gets cleared and the first person who looks at the events list after that happens to go to the featured events list, that's what's going to be cached (which will be really quite wrong as it'll be cached for the main events index action).

Updated by yossarian over 2 years ago

The big fix for this one is to re-work a lot of the routes and templates so that we have consistent, disciplined routes in the app. It's getting a bit late for these kinds of changes just now, what I'll do for tonight is switcharoo the main "events" link to the calendar view and see what people think of that anyway. I'll leave this ticket open until this one's fixed, hopefully I can get at it tomorrow night.

Updated by yossarian over 2 years ago

This should now be fixed, as 08dadf5b and 75cdee0b should contain an EventsController which has separate methods for index, featured, and promoted (the sole use of the index method + a "status" param was causing the caching confusion, all of those actions were sharing the same cache file, i.e. index.html).

Updated by yossarian over 2 years ago

  • Status changed from New to Closed
  • Assigned to set to yossarian
  • Resolution set to fixed

Also available in: Atom PDF