Title: Bug found in include/site.php
Last modified: August 30, 2016

---

# Bug found in include/site.php

 *  Resolved [zakkinen](https://wordpress.org/support/users/zakkinen/)
 * (@zakkinen)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/bug-found-in-includesitephp/)
 * Hi,
 * after some digging I found why some of my categories do not display in the translated
   version. The reason is that term_taxonomy.parent refers to term_taxonomy.term_id,
   NOT to term_taxonomy.taxonomy_id.
    In most cases both are the same, hence the
   bug may not show on many sites. On mine it does.
 * It is easily fixed by changing lines 949 to 955 of site.php (Version 1.47) to:
 *     ```
       // need find parent:
       $term = $wpdb->get_row($wpdb->prepare(
           "SELECT t.term_id, t.slug, tt.taxonomy, tt.parent FROM $wpdb->terms AS t
           INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id
           WHERE tt.taxonomy = %s AND tt.term_id ".(count($translation_parents) === 1 ? '= '.$translation_parents[0] : 'IN ('.implode(',',$translation_parents).')'),
           $taxonomy
       ));
       ```
   
 * As you see, I swapped tt.term_id for tt.taxonomy_id in the WHERE clause.
 * Else, as much as I have seen so far: great tool, great help. Exactly what I was
   looking for.
 * Cheers
    Henrik
 * [https://wordpress.org/plugins/sublanguage/](https://wordpress.org/plugins/sublanguage/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [maximeschoeni](https://wordpress.org/support/users/maximeschoeni/)
 * (@maximeschoeni)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/bug-found-in-includesitephp/#post-6807367)
 * Hello Henrik,
 * Thank you for spotting this bug! I’ll correct it in the next release so don’t
   worry about update.
 * You’re right in most case tt.term_id and tt.term_taxonomy_id are the same, that’s
   why I may have interchanged them. I’m going to double check this.
 * Maxime

Viewing 1 replies (of 1 total)

The topic ‘Bug found in include/site.php’ is closed to new replies.

 * ![](https://ps.w.org/sublanguage/assets/icon-128x128.png?rev=1197494)
 * [Sublanguage](https://wordpress.org/plugins/sublanguage/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sublanguage/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sublanguage/)
 * [Active Topics](https://wordpress.org/support/plugin/sublanguage/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sublanguage/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sublanguage/reviews/)

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [term_id](https://wordpress.org/support/topic-tag/term_id/)
 * [translated](https://wordpress.org/support/topic-tag/translated/)

 * 1 reply
 * 2 participants
 * Last reply from: [maximeschoeni](https://wordpress.org/support/users/maximeschoeni/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/bug-found-in-includesitephp/#post-6807367)
 * Status: resolved