In using the Flag module in a multilingual site we are encountering the foll. issue: the goal is to show translated flagged content if available or default flagged content if not available. In the query generated by views we find that nid is used to do the match with content_id. For our purposes tnid would work better.

So instead of:

SELECT node.nid AS nid,
   node.language AS node_language,
   node_weight.sticky AS node_weight_sticky
 FROM node node 
 INNER JOIN flag_content flag_content_node ON node.nid = flag_content_node.content_id AND flag_content_node.fid = 6

we would want:

SELECT node.nid AS nid,
   node.language AS node_language,
   node_weight.sticky AS node_weight_sticky
 FROM node node 
 INNER JOIN flag_content flag_content_node ON node.tnid = flag_content_node.content_id AND flag_content_node.fid = 6

What is the best way of doing this in Flag or Views?

Comments

mooffie’s picture

JOIN flag_content flag_content_node ON node.tnid = flag_content_node.content_id

If that's all you need then bring in the "Node translation: Source translation" relationship. Then pick this relationship for all the flag fields/filters/relationships (you'll see a new dropdown).

I'm not sure this is all that's needed for a i18n site. Let us know how it's going.

(And check out this page if you want to show flagging links.)

mooffie’s picture

Status: Active » Closed (works as designed)

We have't got a reply from the asker. I'm closing this.