NoMethodError in Todo#list
I've installed Tracks 1.04 sucessfully (at least I thought so). After playing around a little bit, setting up a few contexts, projects and actions, I am now getting a NoMethodError in Todo#list on the start page (http://localhost:3000/). I can access other pages, like e.g. http://localhost:3000/projects, but get the same error on accessing http://localhost:3000/todo/list.
The full message is the following:
As I really like the application so far, I would appreciate any help.
My config: ruby 1.8.4 on Mac OS X 10.4
Greetinx,
Udo
The full message is the following:
NoMethodError in Todo#list
undefined method `hide?' for nil:NilClass
RAILS_ROOT: .
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/controllers/todo_controller.rb:36:in `list'
#{RAILS_ROOT}/app/controllers/todo_controller.rb:36:in `list'
Request
Parameters: None
Show session dump
Response
Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"}
As I really like the application so far, I would appreciate any help.
My config: ruby 1.8.4 on Mac OS X 10.4
Greetinx,
Udo
Leave a comment
on 2006-03-21 14:07 *
By Anonymous
Status changed from New to Accepted
Status changed from New to Accepted
Hmm, that's odd. What database are you using? From the error I'd suggest that you might have an action which has somehow not got a context_id set, or else the hide column of the context is somehow set wrongly. Can you check your database and see whether all your actions have a context_id set, and that the hide property of contexts is set properly (should be either 0 or 1 for MySql databases or 't' or 'f' for SQLite).
I'll set this as help because I don't think that it's a bug with Tracks itself.
I'll set this as help because I don't think that it's a bug with Tracks itself.
Hi, thanks for your help.
After examining the database (sqlite3), I found an entry in the todos table with an invalid context_id (and a project_id of NULL).
I recall that I deleted the first context after playing a little bit. Apparently a todo remained with a context_id which no longer exists. This causes the above mentioned error message. After deleting that todo-record from the table everything works again fine.
So it seems to be an error/defect that when a context is deleted, the todos which belonged to this context now have invalid context ids, thus leading to the 'NoMethodError in ToDo#List'.
Update: I just reproduced this behaviour. Reset severity to critical.
Greetinx, Udo
After examining the database (sqlite3), I found an entry in the todos table with an invalid context_id (and a project_id of NULL).
I recall that I deleted the first context after playing a little bit. Apparently a todo remained with a context_id which no longer exists. This causes the above mentioned error message. After deleting that todo-record from the table everything works again fine.
So it seems to be an error/defect that when a context is deleted, the todos which belonged to this context now have invalid context ids, thus leading to the 'NoMethodError in ToDo#List'.
Update: I just reproduced this behaviour. Reset severity to critical.
Greetinx, Udo
on 2006-03-22 12:36 *
By Anonymous
Status changed from Accepted to Fixed
Status changed from Accepted to Fixed
You're absolutely right -- sorry that I closed it prematurely. The reason that I thought it couldn't be down to 'orphaned' next actions is because we had a :dependent => true option in the context model, which deletes next actions belonging to deleted contexts. However, when nic merged his multi-user stuff into the trunk, this somehow got lost and I didn't notice.
It's reinstated now, and deleting a context also deletes any next actions within that context. Fixed in [206].
It's reinstated now, and deleting a context also deletes any next actions within that context. Fixed in [206].
Applied your fix http://dev.rousette.org.uk/changeset/206 and now it works as it should.
Thanks again for your quick support.
Greetinx, Udo
Thanks again for your quick support.
Greetinx, Udo