Bug found in include/site.php
-
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
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Bug found in include/site.php’ is closed to new replies.