diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index e70f891..6f790b7 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -224,8 +224,9 @@ class Entity implements EntityInterface { * field value. * - If the entity is not language-specific, LANGUAGE_NOT_SPECIFIED should be * used to access all field values. - * - If a field's values are shared among all language versions of an entity, - * LANGUAGE_NOT_SPECIFIED should be used to access them. + * - If a field's values are non-translatable (shared among all language + * versions of an entity), LANGUAGE_NOT_SPECIFIED should be used to access + * them. * * There cannot be valid field values if a field is not translatable and the * requested langcode is not LANGUAGE_NOT_SPECIFIED. Therefore, this function diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php index 40d1488..e5e5e2e 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php @@ -11,7 +11,6 @@ use Exception; use InvalidArgumentException; use Drupal\simpletest\WebTestBase; use Drupal\Core\Language\Language; -use Drupal\entity\EntityStorageException; /** * Tests entity translation. @@ -96,8 +95,8 @@ class EntityTranslationTest extends WebTestBase { $entity->set($this->field_name, array(0 => array('value' => 'default value2')), $this->langcodes[1]); $this->fail($message); } - catch (EntityStorageException $e) { - $this->assertTrue($e instanceof EntityStorageException, $message); + catch (Exception $e) { + $this->assertTrue($e instanceof InvalidArgumentException, $message); } // Test getting a field value using a specific language for a not