Host Content View not showing in Katello webGUI

**Problem:Hosts where the hostgroup’s content view is not set don’t show a content view in the GUI

**Expected outcome:I set a content view on a host and when I go to edit the host the same content view is there.

**Foreman and Proxy versions:katello 3.3.2

Other relevant data:
Running hammer shows the correct content view:
[root@katello3 emanners]# hammer host info --name rancid.xxx.yyy.zzz
Id: 785
Name: rancid.xxx.yyy.zzz
Organization: XXX
Location: Dirac
Host Group: Administrative Nodes
Environment: production
Puppet CA Id: 4
Puppet Master Id: 4
Cert name: rancid.xxx.yyy.zzz
Managed: yes
Installed at:
Last report: 2018/06/27 14:27:46
Network:
IP: 144.aaa.bbb.ccc
MAC: 00:1a:4a:16:01:6e
Subnet: Dirac Administrative Public
Domain: xxx.yyy.zzz
Network interfaces:

  1. Id: 3069
    Identifier: eth0
    Type: interface (primary, provision)
    MAC address: 00:1a:4a:16:01:6e
    IP address: 144.aaa.bbb.ccc
    FQDN:
    Operating system:
    Architecture: x86_64
    Operating System: CentOS 7.3.1611
    Build: no
    Custom partition table:
    Parameters:

Additional info:
Owner Id: 9
Owner Type: User
Enabled: yes
Model: oVirt Node
Comment:
Content Information:
Content View: CentOS7-updated
Lifecycle Environment: PROD
Applicable Packages: 427
Upgradable Packages: 75
Applicable Errata:
Enhancement: 1
Bug Fix: 0
Security: 0
Subscription Information:
UUID: d72f34f2-c9e9-4cd4-8293-9048f9b6aac4
Last Checkin: 2018-06-27 12:25:58 UTC
Service Level:
Release Version:
Autoheal: true
Registered At: 2017-07-28 18:19:43 UTC
Registered by Activation Keys:
1) updated7
Host Collections:

The Katello/Foreman DB does not seem to have a content_view_id for the sample machines:
foreman=# select id,name,content_view_id from hosts where name = ‘rancid.xxx.yyy.zzz’;
id | name | content_view_id
-----±-------------------±----------------
785 | rancid.xxx.yyy.zzz |
(1 row)

If I add the correct content view in the webGUI and hit save, then go back into the edit screen the Content View field is empty again. Any ideas would be appreciated.

Using Foreman 3.7.0 with Katello 4.9.0 and also facing this issue. Are there any news about it eg. bug number, workarounds or solutions?

It may be related to this, which didn’t make it into 4.9 yet:

As a workaround, it may help to ensure your host group assigns both a content view and a lifecycle environment.