redmine-todos-scrum-plugin
redmine-todos-scrum-plugin copied to clipboard
Error with method sort and todoable
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,