Ok, I've put in some time today to try debug this (and just learn how to
debug a RoR app in general, as I had no idea before :)). I'll share my
findings here.
For me, it was dying inside "*app/controllers/users_controller.rb*" - *
show()* method at the line indicated below:
def show
@projects = @user.projects.find(:all, :include => [:tags, { :repositories
=> :project }])
@repositories = @user.commit_repositories
if current_user == @user && params[:events] != "outgoing"
*@events = @user.paginated_events_in_watchlist(:page => params[:page])*
else
@events = @user.events.paginate(
:page => params[:page], :order => "events.created_at desc",
:include => [:user, :project])
end
Ah yes, each user can select the projects they want to watch. What has
happened in my case:
- A while ago, I had added watches to a few projects
- Some of those projects have since been deleted
- In the mySQL DB, my watches to these dead projects are still listed. I
confirmed this via the queries below.
- *SELECT event_id FROM `feed_items` WHERE watcher_id=5*
(In this example, the user-id for my main account is *5* , find your
user-id within the 'users' table)
I get a list of *event_id*'s:
- 1608 = (doesn't exist)
- 1772 = (doesn't exist)
- 1776 = (doesn't exist)
- 1782 = (doesn't exist)
- 2079 = myprojectname1
- 2080 = (doesn't exist)
- 2701 = myprojectname2
- 3413 = myprojectname3
- I then looked in the 'events' table for any event-id that matched ones
from the list above and grabbed the project name from the 'projects' table
*SELECT projects.title FROM events,projects WHERE events.id=3413 AND
events.project_id=projects.id*
Ok, so in my case, I can imagine a few potential solutions I could try.
1. Manually delete these dead watches from the mysql table.
(nice and easy. It will fix it for me, but other colleagues will have
this problem eventually too, and they might not bother telling me about it)
2. Edit "*users_controller.rb*" and comment out the watchlist pagination
stuff
#if current_user == @user && params[:events] != "outgoing"
# *@events = @user.paginated_events_in_watchlist(:page =>
params[:page])*
#else
@events = @user.events.paginate(
:page => params[:page], :order => "events.created_at desc",
:include => [:user, :project])
#end
3. Fix it myself (might take a while)
4. Upgrade to a newer version of Gitorious where issues like this are
probably fixed?
(yeah, one of these days I'll aim for this, not yet though)
Hmm, for now, I might try the easier options, perhaps #2... If that doesn't
work, I'll try #1... Unless anyone can point me in a better direction.
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]