Bug #12712
closedNo searchable link for "Owner" in host properties in non-english languages
Description
If the language isnt english the link in host properties doenst work. This comes from hosts_helper.rb in line 263. Is there any reason for the if-else? It filters for the word "User" which obviously only works for english.
I've attached a screenshot of the code and my workaround.
Files
Updated by Dominic Cleal about 9 years ago
- Category set to Web Interface
- Difficulty set to trivial
The owner_type will only ever be in English, so it should actually check for if host.owner_type == "User"
as it's a DB column.
The second part of the conditional is used when a host is owned by a user group rather than a user, so it doesn't link to the individual user (it could actually link to a search for the group).
If you'd like to get this fixed, please do send the fix via a pull request (see http://theforeman.org/contribute.html).
Updated by René Kaak about 9 years ago
The problem with my workaround is that it leads to a 500 error if the Owner is actually a usergroup. Need to find a way to fix this behaviour.. What is the search-context for usergroup? Trying to figure something out and will report back as soon as I understood some of the helpers better..
Updated by Dominic Cleal about 9 years ago
Yeah, that's why I think the conditional needs fixing instead, because a usergroup object won't have the ".login" that a user does.
It looks like you could use a search like this for hosts owned by a user group: owner_type = Usergroup and owner_id = #{host.owner.id}
(instead of user.login = ...).
Updated by The Foreman Bot about 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2963 added
Updated by The Foreman Bot about 9 years ago
- Pull request https://github.com/theforeman/foreman/pull/2965 added
Updated by Dominic Cleal over 8 years ago
- Status changed from Ready For Testing to New
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
- Assignee set to Tomer Brisker
- Pull request https://github.com/theforeman/foreman/pull/7315 added
Updated by Tomer Brisker about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset 9fdf33b8c6da1f320b2f856106eed8ddd065bf15.
Updated by Tomer Brisker almost 5 years ago
- Category changed from Web Interface to Inventory
- Fixed in Releases 1.24.1 added