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.
The node language filter only supports listing enabled languages which works great for front-end views but can be limiting when creating administration views.
The attach patch allows for this to be changed via an option.
Comment | File | Size | Author |
---|---|---|---|
#12 | views-allow_disabled_languages-401128-12.patch | 2.79 KB | Andrew Answer |
|
Comments
Comment #1
esmerel CreditAttribution: esmerel commentedComment #2
dawehnerThis should be a boolean instead of a string.
Can you explain why this makes more sense?
Comment #3
neclimdulActually since its a select, an integer makes more sense.
As for the weight weirdness, sure. The reason is that the "all languages" form item makes most sense above the other options but when you try to shift the other form items down you'll end up with things ending up in weird places. I'm not sure of a better way to do this other than maybe making changes to views_handler_filter_in_operator which seems less than ideal.
Attached is a patch that addresses the bool/int issue.
Comment #4
crashtest_ CreditAttribution: crashtest_ commentedI think that when the "All" selection is made in the dropdown, that it should populate the Language fieldset with the missing languages. It does currently work but you have to select All, update, then come back to the filter to see the change. Seems somewhat non-intuitive.
I will see if I can work out how to make it dynamic.
Comment #5
dawehnerSo needs work?
Comment #6
crashtest_ CreditAttribution: crashtest_ commentedYeah, needs work. I still haven't looked at it but I will tomorrow afternoon.
Comment #7
dawehnerso
Comment #8
crashtest_ CreditAttribution: crashtest_ commentedSooo, I did a fresh install of D6, cvs'd down the latest D6 version of views, enabled Locale, added a couple of languages, disabled one, added a couple of users, added a node, then went to create a view.
While trying to create a filter for User: Language, I get "Error: handler for users > language doesn't exist!"
I am stuck on that, recreating the view doesn't help. Do you get the same result when trying to ad "User: Language"?
Comment #9
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy commentedThis problem remains.
Locale allows to define multiple languages and enable only some:
admin/config/regional/language
This is common when you want to limit the interface say to two languages, but will be having content in other languages as well.
One site may not have the resources to properly translate all of the interface and still accept content contributions in a separate language.
The content translation module allow translating content into languages that are defined (listed) on admin/config/regional/language even if they are disabled.
But the Language filter in views only allows choosing among enabled languages, forcing us to enable all languages for the interface that we want to support filtering the content by.
Comment #10
yingtho CreditAttribution: yingtho commentedPatched it to Drupal 7 and added option to show the expose all languages or not.
Still missing the dynamic update once you change from enabled to all or vice verse.
Comment #11
Chris Matthews CreditAttribution: Chris Matthews commentedThe 5 year old patch in #10 to views_handler_filter_node_language.inc does not apply to the latest views 7.x-3.x-dev.
Comment #12
Andrew Answer CreditAttribution: Andrew Answer as a volunteer commented