Localizer needs db_rewrite_sql() to be applied to each query that fetches nodes from the database.

Attached patch simply adds db_rewrite_sql() to category_get_containers() and additionally fixes quotes in category_get_distant_child_containers().

Note: This patch does not completely implement Category support for Localizer. See http://drupal.org/node/122964 for information about complete implementation.

CommentFileSizeAuthor
category.inc_.patch1.69 KBsun

Comments

sun’s picture

Status: Needs review » Reviewed & tested by the community

*bump*

Any chance to get this one in? It doesn't affect functionality of Category module. You can even leave out the cosmetic change in category_get_wrapper_status() if you want to.

Localizer v2.x is out now and I'd like to avoid unnecessary bug reports. So just push the magic button, please :)

sun’s picture

bdragon? Anyone?

bdragon’s picture

Uh, yeah. I'll get right on it. Sorry 'bout that.

--Brandon

bdragon’s picture

Status: Reviewed & tested by the community » Needs review

Hmm, I don't like the idea of using db_rewrite_sql there.... I don't want to risk breaking stuff if someone turns on a node access module.

What other approaches do you think can be used here? What's not getting translated properly?

sun’s picture

Without this patch a user is able to add a child container/category to another container that is in a different language. If this happens, the added child is never displayed on a multilingual site. Category module uses db_rewrite_sql() in all other places. Because of that, Localizer and i18n are already able to filter categories by language. I don't see a problem and would rather consider it as a bug, if a user is able to add a child in a container that she is not allowed to access.

sun’s picture

Assigned: sun » Unassigned
Status: Needs review » Closed (won't fix)