Bug #14369
When creating new organization, host selection step won't show, if the user is n context of different organization.
Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Description
Steps to reproduce:
1. Make sure you have a host without organization.
2. Pick an organization for your context (Make sure you have organization name instead of "Any context")
3. Create a new organization
Expected: Redirection to "Step 2" - hosts selector
Actual: Redirection to Edit organization screen.
The problem is in #count_nil_hosts, it uses Host.where(taxonomy_id => nil).count to check for unassigned hosts.
By default this is scoped:
Host.where(taxonomy_id => nil).to_sql #=> "SELECT \"hosts\".* FROM \"hosts\" WHERE \"hosts\".\"type\" IN ('Host::Managed') AND \"hosts\".\"location_id\" IN (12) AND \"hosts\".\"location_id\" IS NULL"
This query will always return 0.
Related issues
Associated revisions
History
#1
Updated by Shimon Shtein almost 5 years ago
Related to http://projects.theforeman.org/issues/14252
#2
Updated by Shimon Shtein almost 5 years ago
- Related to Bug #14252: Creating a new organization redirects to list rather than host assignment and edit properties added
#3
Updated by The Foreman Bot almost 5 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3371 added
#4
Updated by Shimon Shtein almost 5 years ago
- Bugzilla link set to 1321826
#5
Updated by Ivan Necas almost 5 years ago
- Legacy Backlogs Release (now unused) set to 136
#6
Updated by Shimon Shtein almost 5 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset b597a8a5fea1e103af2d81b548b319ebdc92aa5c.
Fixes #14369 - Removed default scope from host counter in taxonomies