Jump to:
| Project: | Default Filter |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
While recently testing Default Filter I realised that on settings page also built-in roles (anonymous and authenticated users) can be selected as roles, but selecting these won't really work, as Drupal won't save any information about these roles to users_roles table, and thus array_keys($user->roles) won't find them.
Now, there are two ways to fix this. Either a) remove built-in roles altogether from the selection list on the settings page, or b) test if the user is authenticated in default_filter_retrieve() and, based on that information, add user to the $roles array either as an anonymous or as an authenticated user before issuing any SQL query.
(For me, it is all the same. This is easy enough to work around that I'm going to worry about #172962 first.)
Comments
#1
I thought this was affecting me, but tracing the code I can see it's working properly. $user->roles does contain RID's 2 and 1 as expected.
This issue can probably be closed.
--Andrew
#2