dalyons / redmine-todos-scrum-plugin

A scrum-like todos plugin for Redmine. Allows easy creation and management of infinitely nestable todo lists on a per project basis, that in the future will be able to be organised into sprints(or releases). Also provides global 'My Todos' for all projects. Todos can be allocated to uses, and tied to Redmine Issues.
142 stars 41 forks source link

Error with method sort and todoable #58

Open ghost opened 12 years ago

ghost commented 12 years ago

Hi,

Thank you for your great plugin! I got the following error with your plugin on my Redmine:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ActionView::TemplateError (undefined method `sort' for nil:NilClass) on line #6 of vendor/plugins/redmine_todos_plugin/app/views/todos/_root_todos.html.erb:
 <% raise unless parent_object %>

     <ul class="todos root" id="<%= TodosController::UL_ID + 'root' %><%='not-editable' unless editable %>">
       <% for todo in todos.sort{|a,b| a.position <=> b.position} %>
           <%= render :partial => 'todos/todo_li', :locals => { :todo => todo, :editable => editable }%>
       <% end %>
     </ul>

    vendor/plugins/redmine_todos_plugin/app/views/todos/_root_todos.html.erb:6
    vendor/plugins/redmine_todos_plugin/app/views/todos/index.html.erb:19
    vendor/plugins/redmine_todos_plugin/app/controllers/todos_controller.rb:109:in `create'

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

and

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

ActionView::TemplateError (undefined method `todoable' for nil:NilClass) on line #5 of vendor/plugins/redmine_todos_plugin/app/views/todos/_new_todo.html.erb:
#New todo: partial for creating a new todo.
#requires:
#   todo : a new Todo object
  parent_object = todo.todoable
  raise unless parent_object

%>

    vendor/plugins/redmine_todos_plugin/app/views/todos/_new_todo.html.erb:5
    vendor/plugins/redmine_todos_plugin/app/views/mytodos/index.html.erb:11
    vendor/plugins/redmine_todos_plugin/app/controllers/todos_controller.rb:109:in `create'

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Could you please help me fix them?

Thanks and regards,