From 295e8c86ab8c7ad19dff2038dc7cda106551e143 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang
Date: Tue, 23 Oct 2007 17:15:00 +0000
Subject: [PATCH] Fixed: error when bulk editing with Postgresql
git-svn-id: http://redmine.rubyforge.org/svn/trunk@866 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
app/controllers/projects_controller.rb | 10 +++++-----
app/views/issues/_bulk_edit_form.rhtml | 2 +-
test/functional/projects_controller_test.rb | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 96025526..377073fc 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -339,11 +339,11 @@ class ProjectsController < ApplicationController
# Bulk edit issues
def bulk_edit_issues
if request.post?
- status = IssueStatus.find_by_id(params[:status_id])
- priority = Enumeration.find_by_id(params[:priority_id])
- assigned_to = User.find_by_id(params[:assigned_to_id])
- category = @project.issue_categories.find_by_id(params[:category_id])
- fixed_version = @project.versions.find_by_id(params[:fixed_version_id])
+ status = params[:status_id].blank? ? nil : IssueStatus.find_by_id(params[:status_id])
+ priority = params[:priority_id].blank? ? nil : Enumeration.find_by_id(params[:priority_id])
+ assigned_to = params[:assigned_to_id].blank? ? nil : User.find_by_id(params[:assigned_to_id])
+ category = params[:category_id].blank? ? nil : @project.issue_categories.find_by_id(params[:category_id])
+ fixed_version = params[:fixed_version_id].blank? ? nil : @project.versions.find_by_id(params[:fixed_version_id])
issues = @project.issues.find_all_by_id(params[:issue_ids])
unsaved_issue_ids = []
issues.each do |issue|
diff --git a/app/views/issues/_bulk_edit_form.rhtml b/app/views/issues/_bulk_edit_form.rhtml
index 6ed94742..bc3f62e6 100644
--- a/app/views/issues/_bulk_edit_form.rhtml
+++ b/app/views/issues/_bulk_edit_form.rhtml
@@ -13,7 +13,7 @@