Project

General

Profile

Actions

Bug #6062

closed

External user group errors cause "no route matches" render error

Added by Dominic Cleal almost 10 years ago. Updated almost 10 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

On the new user group form, when adding an external user group to it under the external groups tab, if validation of the new external group fails and it has to re-render the form to show an error, you get a routing error.

1. Set up LDAP auth (assuming #813 was merged)
2. Go to new user group, enter a name
3. Click add external user group, enter an unknown/invalid name
4. Click submit

Started POST "/usergroups" for 127.0.0.1 at 2014-06-04 14:13:22 +0100
Processing by UsergroupsController#create as */*
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"sz4ToJCX5CIe4unVdbmEHiNbzsWTkyOrQjl96elj8QM=", "usergroup"=>{"name"=>"my users", "user_ids"=>[""], "admin"=>"0", "role_ids"=>[""], "external_usergroups_attributes"=>{"new_external_usergroups"=>{"_destroy"=>"false", "name"=>"", "auth_source_id"=>"3"}, "new_1401887591966"=>{"_destroy"=>"false", "name"=>"cn=users,ou=group,dc=example,dc=com", "auth_source_id"=>"3"}}}}
...
ActionController::RoutingError (No route matches {:action=>"refresh", :controller=>"external_usergroups", :id=>nil}):
  app/helpers/application_helper.rb:26:in `link_to'
  app/helpers/application_helper.rb:168:in `display_link_if_authorized'
  app/views/usergroups/_form.html.erb:37:in `block (2 levels) in _app_views_usergroups__form_html_erb__4184325558407328239_65886080'
  app/views/usergroups/_form.html.erb:33:in `block in _app_views_usergroups__form_html_erb__4184325558407328239_65886080'
  app/helpers/layout_helper.rb:250:in `form_for'
  app/views/usergroups/_form.html.erb:2:in `_app_views_usergroups__form_html_erb__4184325558407328239_65886080'
  app/views/usergroups/new.html.erb:3:in `_app_views_usergroups_new_html_erb___3188424679141652737_65830720'
  app/controllers/application_controller.rb:287:in `process_error'
  app/controllers/usergroups_controller.rb:18:in `create'
  app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
  lib/middleware/catch_json_parse_errors.rb:9:in `call'

It's trying to render a line in the external user groups list with a link to the refresh route, even though it didn't save correctly.

Actions #1

Updated by Dominic Cleal almost 10 years ago

  • Status changed from New to Rejected

Ack, this is actually introduced in #813, my bad.

Actions

Also available in: Atom PDF