If I add a menu link (Main menu) on a multilanguage site I got the following error (admin/structure/menu/manage/main/add):

Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template "content-translation-overview" found for the "menu_link_content" entity type in Drupal\Core\Entity\Entity->urlInfo() (line 189 of core/lib/Drupal/Core/Entity/Entity.php).

And I got the same error when I try to edit this menu (admin/structure/menu/manage/main)

Step to reproduce:
1- Install d8.
2- Go to extend (admin/modules) and install (Content Translation, Interface Translation and Language).
3- Go to Languages (admin/config/regional/language), add a language.
4- Go to Content language (admin/config/regional/content-language) check "Custom menu link" and "Save configuration".
5- Add a menu link to Main navigation menu (admin/structure/menu/manage/main/add) and bump!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rpayanm’s picture

Priority: Normal » Critical
Issue tags: -critical
larowlan’s picture

larowlan’s picture

Assigned: Unassigned » larowlan

taking a captain cook

larowlan’s picture

Component: menu system » menu_link_content.module
Assigned: larowlan » Unassigned
Issue tags: +Needs tests
FileSize
613 bytes

Here's the fix, need a test though

larowlan’s picture

Title: Error when I create a menu link on multilanguage » MenuLinkContent calls getUrlInfo('content-translation-overview') when it should be 'drupal:content-translation-overview'
larowlan’s picture

Status: Active » Needs review
FileSize
3.06 KB

start on a test, can't get $entity->isTranslatable() to return TRUE though, so the translate link doesn't show and the Exception isn't thrown

larowlan’s picture

Issue tags: +D8MI
dawehner’s picture

Issue tags: -Needs tests, -D8MI
FileSize
1.85 KB
1.25 KB

Added a test in the right place.

The last submitted patch, 6: menu-link-fatal-2414047.test.patch, failed testing.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +D8MI

Awesome, thanks!

larowlan’s picture

Thanks

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed f2bee5d on 8.0.x
    Issue #2414047 by dawehner, larowlan: MenuLinkContent calls getUrlInfo('...
rpayanm’s picture

I found another occurrence of this (in code) on core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php:

public function getTranslateRoute() {
  return $this->getEntity()->urlInfo('content-translation-overview');
}

This is ok? or would be fixed?

rpayanm’s picture

ohh sorry for the last comment I forgot to do a "git pull" :( that is exactly the code that was changed in the committed patch :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.