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.
Catalog Block menu is not working with Entity Translation module.
To get the Catalog Block menu to work change uc_catalog.module line 259:
$tree = taxonomy_get_tree($vid);
to
$tree = taxonomy_get_tree($vid, 0, NULL, TRUE);
Comments
Comment #1
TR CreditAttribution: TR commentedDoesn't loading the entities for every taxonomy term have a severe impact on performance and memory usage, especially when you have a big catalog?
taxonomy_get_tree($vid, 0, NULL, FALSE) is the default, and I assume there's a reason for that.
Comment #2
TR CreditAttribution: TR commentedComment #3
TR CreditAttribution: TR commentedComment #4
TR CreditAttribution: TR commentedNo further information provided.
Comment #5
liezie_D CreditAttribution: liezie_D commentedi know this was posted a long time ago, but i was able to get my terms translated in the block by patching uc_catalog.module
in uc_catalog_block_view, update the foreach statement:
foreach ($tree as $knot) {
$seq++;
$knot->sequence = $seq;
//FORCE a translation of the term.
$translatedTerm = i18n_string_translate('/' . $language->language . '/catalog/' . $knot->tid, $knot->name, array());
$knot->name = $translatedTerm;
$knothole = new UcTreeNode($knot);
// Begin at the root of the tree and find the proper place.
$menu_tree->add_child($knothole);
}
Please, take not that in my custom module i add localized translations to my terms with this path:
'/' . $language->language . '/catalog/' . $tid
you will probably use the path array: array('taxonomy', 'term', $tid, 'name')
in which case you should change the line above. i have not tested if it works with the array path, but i expect it will.