Project

General

Profile

Actions

Bug #12712

closed

No searchable link for "Owner" in host properties in non-english languages

Added by René Kaak over 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Inventory
Target version:
-
Fixed in Releases:
Found in Releases:

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

hosts_helper_bug.PNG View hosts_helper_bug.PNG 8.14 KB bug or intened? René Kaak, 12/07/2015 01:42 AM
hosts_helper_fix.PNG View hosts_helper_fix.PNG 10.6 KB my personal workaround René Kaak, 12/07/2015 01:42 AM
Actions #1

Updated by Dominic Cleal over 8 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).

Actions #2

Updated by René Kaak over 8 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..

Actions #3

Updated by Dominic Cleal over 8 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 = ...).

Actions #4

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2963 added
Actions #5

Updated by The Foreman Bot over 8 years ago

  • Pull request https://github.com/theforeman/foreman/pull/2965 added
Actions #6

Updated by Dominic Cleal almost 8 years ago

  • Status changed from Ready For Testing to New
Actions #7

Updated by The Foreman Bot over 4 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
Actions #8

Updated by The Foreman Bot over 4 years ago

  • Fixed in Releases 2.0.0 added
Actions #9

Updated by Tomer Brisker over 4 years ago

  • Status changed from Ready For Testing to Closed
Actions #10

Updated by Tomer Brisker over 4 years ago

  • Category changed from Web Interface to Inventory
  • Fixed in Releases 1.24.1 added
Actions

Also available in: Atom PDF