Merge pull request #2237 from ZeiP/bug/context_change_hidden_fails

Fixed bug causing context change to hidden returning a server error
This commit is contained in:
Jyri-Petteri Paloposki 2019-05-22 19:32:00 +03:00 committed by GitHub
commit ef567c0952
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,8 +75,10 @@ class ApplicationController < ActionController::Base
if todos_parent.nil?
count = 0
elsif (todos_parent.is_a?(Project) && todos_parent.hidden?)
init_hidden_todo_counts(['project']) if !@project_hidden_todo_counts
count = @project_hidden_todo_counts[todos_parent.id]
elsif (todos_parent.is_a?(Context) && todos_parent.hidden?)
init_hidden_todo_counts(['context']) if !@context_hidden_todo_counts
count = @context_hidden_todo_counts[todos_parent.id]
else
count = eval "@#{todos_parent.class.to_s.downcase}_not_done_counts[#{todos_parent.id}]"