Hi,
since the views code has changed a lot in 6.x compared to 5.x, hook_views_pre_query and hook_views_pre_view are no longer feasible to prevent i18n from rewriting queries from the views module.
As consequence, a view listing all of your nodes would return just nodes in your current language if your i18n settings are "just current language" etc. But usually you don't want that because views has its own language filters.
I was discussing this problem with the author of the views module and he decided to add array('view' => &$this) in the (new in 6.x) fourth parameter for the db_rewrite_sql function. The attached patch for i18n.module removes the old code and honors the new parameter to prevent query
rewriting when the query comes from the views module.
It's agains 6.x-1.x-dev from May 14.
cu,
Frank
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | i18n_views_sql_rewrite.patch | 1.34 KB | Frank Steiner |
Comments
Comment #1
Anonymous (not verified) commentedComment #2
jose reyero commentedGreat solution, thank you.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
yang_yi_cn commentedsubscribe