undefined local variable or method `scoped_search_definition' setting when setting permission filters
1) Goto Roles
2) Select "Filters and Permissions" next to a Role
3) Select New filter
4) Select "Architecture" or "Compute Resource" under resource type
Error reported in the server..
NameError (undefined local variable or method `scoped_search_definition' for #<Class:0x0000000c7d4f18>):
Rendered /home/paji/.rvm/gems/ruby-2.0.0-p481/gems/actionpack-3.2.18/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.8ms)
Rendered /home/paji/.rvm/gems/ruby-2.0.0-p481/gems/actionpack-3.2.18/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.7ms)
Rendered /home/paji/.rvm/gems/ruby-2.0.0-p481/gems/actionpack-3.2.18/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (5.9ms)
#2 Updated by Dominic Cleal over 5 years ago
- Subject changed from Unable to set permission filters to undefined local variable or method `scoped_search_definition' setting when setting permission filters
- Status changed from New to Need more information
Can you add some debug and work out what class it's failing on? Especially if you have plugins like Katello installed, since I can't replicate this on a clean Foreman installation.
It would appear from a quick code inspection that the class might not be using scoped_search, but is responding to
search_for (i.e. that it's "granular" according to Filter#granular but the class doesn't respond to scoped_search_definition).
#3 Updated by Dominic Cleal over 5 years ago
- Status changed from Need more information to New
Oh, I think I see... #5664 starts using .scoped_search_definition, but this was only added in scoped_search 2.7.0 while we depend on >= 2.6.2.
Please try updating scoped_search to >= 2.7.0 and see if that fixes it.