Getting undefined method `name' for nil:NilClass when trying edit/view a host group
Description of problem:
When trying to view or edit a host group the following error is seen in the webui:
undefined method `name' for nil:NilClass
The entire traceback can be found here: http://pastebin.test.redhat.com/40871
So far, unable to reproduce.
Steps to Reproduce:
1. Attach properties to host group (puppet modules, kickstarts, etc)
2. Remove property being used in host group
3. Attempt to view/edit group
Removing a property being used by a host group renders the group inaccessible
Removing a property in use by the group should simply remove the property from the group and still be able to be edited.
#1 Updated by Tomer Brisker over 4 years ago
1. Create HG with os, arch and content view and save.
2. Edit same HG and remove the arch and os, save.
3. Reopen the HG - it crashes.
Stack trace: | NoMethodError: undefined method `name' for nil:NilClass | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-126.96.36.199/app/models/katello/concerns/redhat_extensions.rb:76:in `distribution_repositories' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-188.8.131.52/app/models/katello/concerns/redhat_extensions.rb:59:in `kickstart_repos' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-184.108.40.206/app/helpers/katello/hosts_and_hostgroups_helper.rb:190:in `kickstart_repository_options' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-220.127.116.11/app/helpers/katello/hosts_and_hostgroups_helper.rb:56:in `kickstart_repository_id' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-18.104.22.168/app/helpers/katello/hosts_and_hostgroups_helper.rb:43:in `use_install_media' | /usr/share/foreman/app/views/common/os_selection/_operatingsystem.html.erb:2:in `block in _5e049f3c8b8a59d4b5ba7658ce33472b'