Problem description: If a parent hostgroup doesn't have any templates linked to it, then when it is selected as context in overlay dialogues it disappears from the corresponding multiselect field.
Steps to reproduce:
- Make sure that parent host group doesn't have any templates linked to it directly
- Navigate to Configuration => Templates
- Press "Select" next to the filter field "Linked templates"
- In the opened overlay dialogue in context field "Host group" select "Templates"
Result: After "Templates" hostgroup was selected, its name vanishes from the Host group multiselect field.
Expected: The group that is selected in Host group field should remain visible in this field.