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.
Problem/Motivation
Noticed while manually testing #2301317: MenuLinkNG part4: Conversion
Steps to reproduce:
- Install 8.x
- set always show errors (admin/config/development/logging)
- enable custom menu links, language and content translation modules.
- Enable content translation for Custom menu links.
- Create a custom menu link.
- Add a new language.
- Go to the translate page for that menu link.
- Click add to add a translation for that new language.
- Error is "invalidArgumentException: Invalid translation language (fi) specified".
InvalidArgumentException: Invalid translation language (fi) specified. in Drupal\Core\Entity\ContentEntityBase->addTranslation() (line 746 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\Core\Entity\ContentEntityBase->addTranslation(fi, [Array])
content_translation_prepare_translation(Drupal\menu_link_content\Entity\MenuLinkContent, Drupal\Core\Language\Language, Drupal\Core\Language\Language)
content_translation_add_page(Drupal\menu_link_content\Entity\MenuLinkContent, Drupal\Core\Language\Language, Drupal\Core\Language\Language)
Drupal\content_translation\Controller\ContentTranslationController->add(Symfony\Component\HttpFoundation\Request, af, fi)
call_user_func_array([Array], [Array])
Drupal\Core\Controller\HtmlPageController->getContentResult(Symfony\Component\HttpFoundation\Request, \Drupal\content_translation\Controller\ContentTranslationController::add)
Drupal\Core\Controller\HtmlPageController->content(Symfony\Component\HttpFoundation\Request, \Drupal\content_translation\Controller\ContentTranslationController::add)
call_user_func_array([Array], [Array])
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Symfony\Component\HttpFoundation\Request, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Symfony\Component\HttpFoundation\Request, 1, TRUE)
Drupal\Core\DrupalKernel->handle(Symfony\Component\HttpFoundation\Request)
Proposed resolution
- ?
- clear caches after adding a language
- do something to menu links so it notices new languages
Remaining tasks
Discuss problem and possible solutions
User interface changes
No.
API changes
No?
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedhappens with nodes also.
Comment #2
YesCT CreditAttribution: YesCT commentedComment #3
dawehner.
Comment #4
dawehnerI do get the follow error mesage:
Comment #13
quietone CreditAttribution: quietone as a volunteer commented@YesCT, thank you for reporting this problem with translating menu links.
I tested this on 8.8.x, following the instructions in the IS, and was not able to reproduce the error. I was able to complete the creation of a translation of a menu link with out error.
Closing this as cannot reproduce.