Compatibility with Translatable menu link uri (translatable_menu_link_uri)

Created on 15 December 2021, about 3 years ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

Currently exists an compatibility issue related with the Translatable Menu Link Uri module, if is active doesn't works properly with TB Megamenu, This is caused by the natural behavior of this module that use the link field provided by Drupal.

So we need a new behavior in case that you are using Translatable Menu Link Uri module to allow set the url using the overrided field.

Steps to reproduce

1. Install TB Megamenu and place the TB Megamenu navigation block.
2. Install translatable_menu_link_uri module following the author instructions.
3. Go to your menu and translate some link setting some Override links.
4. Go to your website and select the language that you previously setting your Overrided link.
5. Check that this links maintain the original url, not overrided url.

Proposed resolution

Before setting final url of menu item check if this module is active and the link has an Override.

Feature request
Status

RTBC

Version

3.0

Component

Code

Created by

🇪🇸Spain jdmoreno

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States inversed

    This was super helpful! I modified the patch to work without a dependency on the menu items extra module as well as set the language selection to use the content.

    This is working for me on 8.x-1.7.

  • 🇮🇳India Jaspreet-Kaur

    Reviewed ! patch #5 worked for me. Thanks

  • I've encountered the same problem with version 3.0.0-alpha2 in Drupal 10.2.2.
    Since I'm not really into building modules or patches, I'd highly appreciate it if someone could provide a patch for the latest version (2 and 3) of tb_megamenu.

    Thanks!

  • 🇨🇦Canada Brownell Toronto, Ontario

    This version of the patch is working well for me on version 3.0.0-alpha2 in Drupal 10.2.4.

  • First commit to issue fork.
    • d26d50de committed on 3254556
      Issue #3254556 by brownelltyler, themodularlab: Compatibility with...
  • Status changed to RTBC 9 months ago
  • 🇺🇸United States themodularlab

    Reviewed the 3.x patch. Merging it now. I'll look to get the 1 and 2.x versions update soon, but continue to rely on the patches for those in the meantime.

    • themodularlab committed 53b8e6bc on bugfix/TBMM-3366359
      Issue #3254556 by brownelltyler, themodularlab: Compatibility with...
      
  • 🇫🇷France yvalentin

    Hi there,

    I encountered another issue with this one, while using translated links to custom paths generated by a custom module.
    The concerned paths looks like: /l/parameter

    When I translate the links through translatable_menu_link_uri interface, tb_megamenu render them wrongly when viewed in the translated language.

    Example:
    Let say my website home URL is https://www.example.com, and my default language is english.
    I have this link: /l/settings, that is translated to /l/parametres in french.
    On front-office in the default language, the link renders correctly: https://www.example.com/l/settings
    But when viewing the french version of the site, the link renders this way: internal:/l/parametres

    It seems to be linked of the way the URL is generated. The translatable_menu_link_uri module use the getUrl() method while tb_megamenu use getValue()['uri'], and that is where it fails.

Production build 0.71.5 2024