I needed to be able to filter the language of the nodes, so I wrote this patch. It works fine for me, but give it a test. You need to have more than one language enabled to be able to see the new filter.
:)
| Comment | File | Size | Author |
|---|---|---|---|
| cmf_language_support.patch | 2.06 KB | naxoc |
Comments
Comment #1
jolidog commentedWorks great for me! Thank you naxoc
Also I've tried to add a language column to the table layout by doing the following:
in the node.inc file
around line 70:
around line 168:
in the cmf.module file
around line 468:
around line 520:
It works but only for node content, I couln't figure out the query to make it work with both content.
Also the title of the column is "Lang" as to save horizontal space since que query is retriving the language as "en", "pt-pt" etc.
I don't know how to make a patch, but since it's an incomplete work, maybe someone can take this and finish it.
Comment #2
nancydruSince 5.x does not store the language, this would have to be a 6.x only fix.
@Jolidog: the comment table does not have a language column, so the UNION clause would have to include a dummy column, much like it does for "changed."
Comment #3
nancydruFor my own reference, if I get commit access:
Comment #4
nancydru@naxoc: Thank you for the patch, it was helpful.
To both of you: You both obviously know that you have locale enabled, but there are many sites that do not, so there needs to be checks for that. You also didn't seem to realize that sites that never had locale, especially from before D6, had empty values in the language column of the node table, and that should show as "Language neutral."
I worked with your patches and took care of those problems. The fix is committed to 6.x-1.x-dev. Please test it thoroughly.
Comment #5
jolidog commentedThank you NancyDru!
It obvious now that you explained it, my mind is set to being a designer/themer, I try to help, touch the code here and there, but I realy don't know what I'm doing as a developer. :P
I'm going to test the dev version.
Comment #6
nancydruYour code above was very good, other than the assumption about the presence of Locale. Even I sometimes do that when I am writing a site-specific module. But, Drupal contrib module maintainers need to consider these things, and many more. I hope I got all the bases covered.
Comment #7
nancydruIncluded in new release.