Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I found this issue because I was filtering the display of some terms if there was some content associated with it or not. One term was not showing up, even if a node had the term.
On the term page the node was not listed and there was the message that no content was associated with this term. When I tried to do a dpq
at the end of the taxonomy_select_nodes
function I got this query:
SELECT t.nid AS nid, t.tid AS tid, t.sticky AS sticky, t.created AS created
FROM
{taxonomy_index} t
INNER JOIN {node} node ON t.nid = node.nid
WHERE (t.tid = '382') AND (node.language IN ('fr', 'und'))
ORDER BY t.sticky DESC, t.created DESC
Eventually the node containing the term was first created in german and then translated to french. So in the node
table in mysql this node has the language column set to 'de'.
To reproduce:
- Enable at least 2 languages (english + french for exemple)
- Create a new taxonomy and set it to "localize", add a term and localize it.
- Add the new taxonomy as field to one content type.
- Create a content in english, add the term to it.
- Translate the content to french, keep the term associated to it.
- Now if you go to the term page in english the node should be listed, in french it doesn't work.
Comments