Defect #6457
closed
Added by Ferry de Kruyff over 14 years ago.
Updated about 14 years ago.
Description
Hi,
I get a blank page when i change the user group off a user.
Error log on server:
Processing UsersController#edit (for 80.56.*.* at 2010-09-21 15:16:28) [POST]
Parameters: {"user"=>{"group_ids"=>["20", ""]}, "commit"=>"Save", "action"=>"edit", "authenticity_token"=>"Pt6QH/+A4nYLrKHlzPDsOcj+5AYJtnbxfOHG8f2VYCk=", "id"=>"28", "controller"=>"users"}
ActiveRecord::RecordInvalid (Validation failed: Project can't be blank):
app/models/group.rb:38:in `user_added'
app/models/group.rb:33:in `user_added'
app/models/user.rb:36
app/controllers/users_controller.rb:101:in `edit'
- Assignee set to Eric Davis
- Assignee deleted (
Eric Davis)
We have same problem trying to add an existing user to an existing group:
Processing UsersController#edit (for 10.240.193.201 at 2010-10-19 10:47:30) [POST]
Parameters: {"user"=>{"group_ids"=>["32", ""]}, "commit"=>"Guardar", "action"=>"edit", "authenticity_token"=>"IHXGuXkHfQi7BWfyXtnLqunEY74WuHbWXlkDTMK0Kk4=", "id"=>"104", "controller"=>"users"}
ActiveRecord::RecordInvalid (translation missing: es, activerecord, errors, messages, record_invalid):
app/models/group.rb:38:in `user_added'
app/models/group.rb:33:in `user_added'
app/models/user.rb:36
app/controllers/users_controller.rb:99:in `edit'
passenger (2.2.11) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
passenger (2.2.11) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/utils.rb:184:in `safe_fork'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:163:in `start'
passenger (2.2.11) lib/phusion_passenger/railz/application_spawner.rb:213:in `start'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
passenger (2.2.11) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
passenger (2.2.11) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
Using redmine 1.0.1.
Any news about this problem or idea when could be resolved?
Have you ever meddled with the DB directly? For example removed a user or something like that?
Can you try this patch?
Index: app/models/group.rb
===================================================================
--- app/models/group.rb (revision 4388)
+++ app/models/group.rb (working copy)
@@ -31,6 +31,7 @@
def user_added(user)
members.each do |member|
+ next if member.project.nil?
user_member = Member.find_by_project_id_and_user_id(member.project_id, user.id) || Member.new(:project_id => member.project_id, :user_id => user.id)
member.member_roles.each do |member_role|
user_member.member_roles << MemberRole.new(:role => member_role.role, :inherited_from => member_role.id)
- Status changed from New to Resolved
Great! This patch works out of the box for Redmine 1.0.1. Thanks!
- Category set to Database
- Assignee set to Jean-Philippe Lang
- Target version set to 1.0.4
- Status changed from Resolved to Closed
- Affected version (unused) set to 1.0.3
- Resolution set to Fixed
- Affected version set to 1.0.3
Also available in: Atom
PDF