summaryrefslogtreecommitdiffstats
path: root/app/controllers/timelog_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-22 10:37:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-22 10:37:57 +0000
commit13f28858baf5965502456d25142631744aa69ce0 (patch)
tree456b61d03256cd16b253612e6b37e10bce0ebf9e /app/controllers/timelog_controller.rb
parent41e82c4598767d9bfaf81b890b1597d072853a6c (diff)
downloadredmine-13f28858baf5965502456d25142631744aa69ce0.tar.gz
redmine-13f28858baf5965502456d25142631744aa69ce0.zip
Fixed that project is ignored when entering an issue id on /time_entries/new form (#10020).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8693 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/timelog_controller.rb')
-rw-r--r--app/controllers/timelog_controller.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
index 277b730a1..dfa96d2d7 100644
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -262,12 +262,14 @@ private
end
def find_project
+ if (project_id = (params[:project_id] || params[:time_entry] && params[:time_entry][:project_id])).present?
+ @project = Project.find(project_id)
+ end
if (issue_id = (params[:issue_id] || params[:time_entry] && params[:time_entry][:issue_id])).present?
@issue = Issue.find(issue_id)
- @project = @issue.project
- elsif (project_id = (params[:project_id] || params[:time_entry] && params[:time_entry][:project_id])).present?
- @project = Project.find(project_id)
- else
+ @project ||= @issue.project
+ end
+ if @project.nil?
render_404
return false
end