Hi

I've created a 'User' view, but would like not to list 'Anonymous' and 'Administrator' in that view. I believe setting up a filter which filters our users with uid > 1 would be a good way to achieve this.

However, even though I can select 'User: Uid' as a field, I'm unable to filter on it.

Any thoughts?

CommentFileSizeAuthor
#1 uid.png30.42 KBtasc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tasc’s picture

FileSize
30.42 KB

same here,
but using Filter: 'User revision: Vid (> 1)' instead works.
(when User Revision -Module is installed)

There is some option pretending to filter for UID but it seems broken at all:
User: Name
- The user ID

see screenshot.

strange that there is no "views_handler_filter_user_uid"

damiankloip’s picture

Category: bug » feature

This is because views currently uses the user name instead in the UI, as a filter for users. So you would use the User: Name filter but the query will use the uid. This is currently a 'works as designed', not a bug. So I guess this could be a feature request.

AdamGerthel’s picture

Category: feature » bug

@damiankloip you're missing the bug. The filter doesn't work. You can't filter on it, because you only get the radio buttons but no input filter. See the screenshot that tsc_a posted.

AdamGerthel’s picture

Update: The field is there but has "display: none" as inline css. So the javascript seems to be faulty.

damiankloip’s picture

This works fine for me, have you tried the dev version? I can filter by users ok, and it puts the uid condition in the query etc...

hawkbreeze’s picture

Feature request submitted.

http://drupal.org/node/1713032

damiankloip’s picture

I can get some strange behaviour grouped filter radio is selected and then the expose filter checkbox is unchecked again, the normal filter options then disappear. Is this what is happening maybe? Just trying to get closer to fixing what this might be.

damiankloip’s picture

i.e. an issue with views_handler_filter_numeric form.

rooby’s picture

Title: Unable to filter by 'User: Uid' when adding multiple filters at once » Unable to filter by 'User: Uid'

I have been noticing things like this for a while.

Just had a bit of an investigate and it seems to only happen if I add multiple filters at once.
It also doesn't seem specific to UID.

For example, if I add just UID by itself it works, and keeps working. (I have other filters but they weren't added at the same time as UID.)

If I add user role & uid filters at the same time, I select a user and save, then select a role and save. Then when it goes back to the main edit view page, the user I selected has not actually been selected and it says user "User: Name (in Unknown)".
From then on if I go back into that filter there is no autocomplete.

I have done a few tests and:
* I add "User: Created date", "User: Language", "User: Name" (as a side note, why is user ID called User: Name?): I get to enter a date filter, then I get to select a language, then it just breaks out without giving me the option to set a user ID. When I get back to the view, date filter did not save, language did save, user id did not save because I didn't have a chance to enter it.
* I add "User: Language" and "User: Name": I get to select a language, and then I get to select a user. Both filters save ok.
* I add "User: Name" and "User: Roles": It lets me select a user, then select a role. Name did not save but roles did.
* I add "User: Active", "User: Current" and "User: Name": I get to set values for active & current and then it drops back to views before I get to name. Active & Current saved correctly but obviously not name.

This is unrelated to the UID filter as it happens even when you select multiple other filters.

Similar things happen when you select multiple fields or multiple sorts.

I can confirm that when you go to the UID filter:

<div class="form-item form-type-textfield form-item-options-value" style="display: none; " role="application">
</div>

which wraps the element, has been given display none.
However that might be beacuse the filter has been incorrectly saved when I added two filters at once (uid & roles).

[edit] Also, none of my filters are exposed.

rooby’s picture

Title: Unable to filter by 'User: Uid' » Unable to filter by 'User: Uid' when adding multiple filters at once