diff --git a/lib/Drupal/config_translation/Access/ConfigNameCheck.php b/lib/Drupal/config_translation/Access/ConfigNameCheck.php index 0ac08a9..a674347 100644 --- a/lib/Drupal/config_translation/Access/ConfigNameCheck.php +++ b/lib/Drupal/config_translation/Access/ConfigNameCheck.php @@ -31,7 +31,7 @@ class ConfigNameCheck implements AccessCheckInterface { $entity = $request->attributes->get($mapper->getType()); // Get configuration group for this mapper. $group = $mapper->getConfigGroup($entity); - $group_language = language_load($group->getLangcode()); + $group_language = $group->getLanguageWithFallback(); $langcode = $request->attributes->get('langcode'); $language = empty($langcode) ? NULL : language_load($langcode); @@ -39,14 +39,15 @@ class ConfigNameCheck implements AccessCheckInterface { // Only allow access to translate configuration, if proper permissions are // granted, the configuration has translatable pieces, the source language // and target language are not locked, and the target language is not the - // original submission language. Although technically config can be overlayed - // with translations in the same language, that is logically not a good idea. + // original submission language. Although technically config can be + // overlayed with translations in the same language, that is logically not + // a good idea. return ( user_access('translate configuration') && $group->hasSchema() && $group->hasTranslatable() && !$group_language->locked && - (empty($language) || (!$language->locked && $language->langcode != $group_language->langcode)) + (empty($language) || ($language->langcode != $group_language->langcode)) ); }