Choose different org will result in the same org's host number change in organizations page
|Assigned To:||Daniel Lobato Garcia|
|Category:||Organizations and Locations|
|Target version:||Team Daniel - Iteration 9|
|Found in release:||Pull request:||https://github.com/theforeman/foreman/pull/4234|
|Velocity based estimate||-|
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1415025
Description of problem:
In organizations page, when you select a org, the other org's host number is wrong.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. In satellite webUI, Create a new org named org1.
2. Registered 7 hosts to org1, make sure no host on Default_organization.
3. Go to "Management organization", choose org1, it's correct to show org1's host number is 7, please see screenshot org1.jpeg.
4. Go to "Management organization", choose Default_organization, check the org1's host number.
It will show org1's host number is 0. please see screenshot default_org.jpeg
No matter what org is choosen in organization page, the host's number in the same org shouldn't change. the host's number in org1 should always 7.
Fixes #18260 - Display proper organizations count on table
If the user is scoped to taxonomy "A", "Host.count" will only return
hosts in that taxonomy. That is correct. However there is a usecase
where we want to display the hosts count regardless of the current
The table for locations and organizations was showing the "Host.count"
scoped to the current taxonomy, so it would show 0 everywhere but in the
The fix is to make the helper aware of this issue, and show the unscoped
Host.count when displaying the organizations/locations table