Bug #16463
closedwith_taxonomy_scope returns all objects when no taxable ids available
Description
Currently scoping by taxonomies is broken.
Before this commit: https://github.com/theforeman/foreman/commit/35ed04f95f14c934ffebc874e90a3a4a6684fe71
`scope = scope.where(:id => taxable_ids) if taxable_ids`
did STILL call `scope.where(:id => [])` when taxable_ids were not found.
That returns an empty scope, and is the appropriate thing to do if there are no taxable IDs.
However after the commit, `if taxable_ids.present?` will make scope return `1=1` for the case where there are no taxable IDs.
If there are some taxable IDs, it does the right thing and scopes the object properly. That use case works fine.
Updated by Dominic Cleal almost 8 years ago
- Related to Bug #16389: Can't create taxable e.g. domain object if I'm in context of specific organization or location added
Updated by Dominic Cleal almost 8 years ago
- Status changed from New to Assigned
- Translation missing: en.field_release set to 181
Updated by The Foreman Bot almost 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/3824 added
Updated by Marek Hulán almost 8 years ago
- Translation missing: en.field_release changed from 181 to 160
The introducing commit is not present in 1.12 so I think this should go to 1.13 where it's present. Feel free to reset if I'm mistaken.
Updated by Dominic Cleal almost 8 years ago
The change introducing the bug is currently set for inclusion in 1.12.3, so just setting this the same. Should #16389 be changed?
Updated by Daniel Lobato Garcia almost 8 years ago
At your will, both have to be introduced at the same time though. I'd prefer to introduce them both on 1.13 to play safe with 1.12.3
Updated by Dominic Cleal almost 8 years ago
Yes, they need to be on the same release. I opted for the point release on the other because I felt it was a somewhat severe bug, though it has a reasonably easy workaround.
Updated by Marek Hulán almost 8 years ago
- Translation missing: en.field_release changed from 160 to 181
Ok, makes sense, moving this back to 1.12.3 because of severity. Sorry for the noise.
Updated by Daniel Lobato Garcia almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset d08290be7b0bca2d4517e297b46daa41949f8791.