Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using Views to generate listings of users in a multilingual site, but I can't seem to get the language as a field/filter.
I can see field handlers for almost every column in the users table, but not language.
A filter on language would sound handy as well, fe a list of recent users in the current language.
Is this intentionally not implemented (or in another module) or am I missing something here? :)
Comment | File | Size | Author |
---|---|---|---|
#13 | user.views_.inc_.patch | 529 bytes | tamerzg |
#5 | views-handler_user_language_V2.patch | 381 bytes | ayalon |
#5 | language.png | 6 KB | ayalon |
#3 | views-handler_user_language.patch | 2.44 KB | dawehner |
#2 | views-handler_user_language.patch | 2.82 KB | dawehner |
Comments
Comment #1
nikitas CreditAttribution: nikitas commentedhave u tried adding an argument with the node translation option and then add a filter with the node translation option?
but i dont know if this will help you.
p.s:This works for creating a view with nodes but i believe that there will be something similar for the users.
Comment #2
dawehnerhe wants to have a field for the user language, on listings of users
Comment #3
dawehnerthere has to be a check_plain
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedLooks nice! Committed.
Comment #5
ayalon CreditAttribution: ayalon commentedI tested this and its working.
But I have one improvement:
Currently the user language can be filtered by a string filter. This doesn't make sense because normally one filters content by the user-language and the current website language.
Because of this I slightly improved the filter to "views_handler_filter_node_language". With this filter you may choose any of the existing language and also the current language.
I tested this on my page and its working correctly.
Can this change be committed too?
Comment #6
dawehneryou didn't attached the handler in the patch :)
Comment #7
ayalon CreditAttribution: ayalon commentedThe patch has already been commited. The patch is made for the latest version of views. Its a patch for your patch :-)
Comment #8
dawehnerups sry
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedCommited to 2.x and 3.x branches.
Comment #11
tamerzg CreditAttribution: tamerzg commentedThe patch in #5 makes handler broken (Broken/missing handler: users > language) if Locale module is not enabled and configured.
Comment #12
tamerzg CreditAttribution: tamerzg commentedActually Locale module doesn't matter. Couldn't get it to work. If I revert changes from #5 it works.
Comment #13
tamerzg CreditAttribution: tamerzg commentedHere is the patch.
Comment #14
bojanz CreditAttribution: bojanz commentedOkay, what happened here?
The handlers that #5 made default don't exist. Not the files, or the entries in user_views_handlers().
Was there a wrong commit along the way?
#13 should fix it....
Comment #15
dawehnerAre we really sure we want to remove a feature?
Comment #16
bojanz CreditAttribution: bojanz commentedKnew it was a good idea to ping you :)
This rules out #13 as the right fix.
Comment #17
MustangGB CreditAttribution: MustangGB commented