Bug #7898
closedError when adding a LDAP Auth Source
Description
Hi,
I have this error (see screenshot) when adding an ldap source. I am using a recent nightly build. 1.7.0-develop. Unfortunatell I can`t provide more information.
Files
Updated by Dominic Cleal about 10 years ago
- Translation missing: en.field_release deleted (
21)
Looks like it's due to https://github.com/rails/rails/issues/7837
In a couple of places in app/controllers/application_controller.rb we test request.format, but it may be nil. We should use request.format.try(:json?)
or check for nil explicitly.
To reproduce, add ?format=weird
to the request URL on any page. I can't think why this would be affecting the LDAP page in particular.
Updated by Björn Dieding about 10 years ago
- File Unbenannt2.PNG Unbenannt2.PNG added
I can confirm with the next screenshot that the error is the same when I add "?format=weird".
Updated by Dominic Cleal about 10 years ago
Ah, I see how to reproduce it!
1. add an LDAP auth source called "test.foo" (e.g. server: ldap.forumsys.com)
2. edit the LDAP auth source + save
The "test.foo" is part of the URL because it's the identifier for the auth source, but ".foo" causes Rails to interpret that as the request format. That's potentially dangerous, if you added "test.yaml" it might cause a formatting change.. we should probably remove "." from the resource identifiers?
Setting back to 1.7.0 as I guess this might be a friendly_id related regression.
Updated by Dominic Cleal about 10 years ago
- Related to Feature #4386: implement gem friendly_id to simply find by id, name, label, etc added
Updated by Dominic Cleal about 10 years ago
- Translation missing: en.field_release set to 21
Updated by Björn Dieding about 10 years ago
I am glad that you were able to reporduce. Let me know, if you need me for anything else.
Updated by The Foreman Bot about 10 years ago
- Status changed from New to Ready For Testing
- Target version set to 1.7.2
- Pull request https://github.com/theforeman/foreman/pull/1858 added
- Pull request deleted (
)
Updated by Shlomi Zadok about 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset f4cecb481293915fbd0241080aa70f7e0ed1b1d3.