Defect #6457
closedEdit User group problem
0%
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'
Related issues
Updated by Jose Javier Sianes Ruiz over 14 years ago
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.
Updated by Jose Javier Sianes Ruiz about 14 years ago
Any news about this problem or idea when could be resolved?
Updated by Felix Schäfer about 14 years ago
Have you ever meddled with the DB directly? For example removed a user or something like that?
Updated by Jean-Philippe Lang about 14 years ago
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)
Updated by Jose Javier Sianes Ruiz about 14 years ago
- Status changed from New to Resolved
Great! This patch works out of the box for Redmine 1.0.1. Thanks!
Updated by Jean-Philippe Lang about 14 years ago
- Category set to Database
- Assignee set to Jean-Philippe Lang
- Target version set to 1.0.4
Updated by Jean-Philippe Lang about 14 years ago
- 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
Fix committed.