diff -u b/core/includes/bootstrap.inc b/core/includes/bootstrap.inc --- b/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -2773,8 +2773,9 @@ // Fill in master language list based on current configuration. $default = language_default(); if (language_multilingual() || module_exists('language')) { - // Use language module configuration if available. - $language_entities = entity_load_multiple('language'); + // Use language module configuration if available. Always reset the entity + // cache as the language objects are statically cached. + $language_entities = entity_load_multiple('language', NULL, TRUE); uasort($language_entities, 'language_entity_sort'); // Initialize default property so callers have an easy reference and can // save the same object without data loss. only in patch2: unchanged: --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -10,6 +10,7 @@ use Drupal\entity\EntityFieldQuery; use Drupal\entity\EntityMalformedException; use Drupal\entity\EntityStorageException; use Drupal\entity\EntityInterface; +use \stdClass; /** * Implements hook_help(). @@ -49,8 +50,15 @@ function entity_modules_disabled() { * @see hook_entity_info_alter() */ function entity_get_info($entity_type = NULL) { - $language_interface = language(LANGUAGE_TYPE_INTERFACE); - + // We need a special exception for the language config entity as this call to + // language will lead to the turtles gettings language negotiaiton wrong. + if ($entity_type != 'language') { + $language_interface = language(LANGUAGE_TYPE_INTERFACE); + } + else { + $language_interface = new stdClass; + $language_interface->langcode = LANGUAGE_NOT_SPECIFIED; + } // Use the advanced drupal_static() pattern, since this is called very often. static $drupal_static_fast; if (!isset($drupal_static_fast)) {