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.
Issue fork tb_megamenu-3254556
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jdmoreno commentedComment #3
jdmoreno commentedPatch fix.
Comment #4
jdmoreno commentedComment #5
inversed commentedThis 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.
Comment #6
Jaspreet-Kaur commentedReviewed ! patch #5 worked for me. Thanks
Comment #7
meder commentedI'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!
Comment #8
brownelltylerThis version of the patch is working well for me on version 3.0.0-alpha2 in Drupal 10.2.4.
Comment #11
themodularlabReviewed 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.
Comment #14
amer cloudy commentedplease don't use it :)
Comment #15
yvalentin commentedHi 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.
Comment #16
liam morlandThis issue appears to have been fixed in #12. @yvalentin if you are still having a problem, I suggest you open a child issue.
Comment #18
rbrownell