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?