Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297886

Allowed language langcode argument cached cause Error

$
0
0

Problem/Motivation

Noticed while manually testing #2301317: MenuLinkNG part4: Conversion

Steps to reproduce:

  1. Install 8.x
  2. set always show errors (admin/config/development/logging)
  3. enable custom menu links, language and content translation modules.
  4. Enable content translation for Custom menu links.
  5. Create a custom menu link.
  6. Add a new language.
  7. Go to the translate page for that menu link.
  8. Click add to add a translation for that new language.
  9. 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?


Viewing all articles
Browse latest Browse all 297886

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>