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

CommentFileSizeAuthor
#1 i18n_views_sql_rewrite.patch1.34 KBFrank Steiner

Comments

Anonymous’s picture

StatusFileSize
new1.34 KB
jose reyero’s picture

Status: Needs review » Fixed

Great solution, thank you.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

yang_yi_cn’s picture

subscribe