diff --git a/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php index b36672e..b094ff5 100644 --- a/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -276,7 +276,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { /** * Default value callback for 'uid' base field definition. * - * @see ::baseFieldDefinitions() + * @see \Drupal\file\Entity\File::baseFieldDefinitions::baseFieldDefinitions(). * * @return array * An array of default values. diff --git a/core/modules/file/src/FileAccessControlHandler.php b/core/modules/file/src/FileAccessControlHandler.php index a055945..c53b1f8 100644 --- a/core/modules/file/src/FileAccessControlHandler.php +++ b/core/modules/file/src/FileAccessControlHandler.php @@ -50,7 +50,7 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter $file_uid = $entity->get('uid')->getValue(); // Only admin users and the file owner can delete and update the file entity. if ($account->hasPermission('administer nodes') || $account->id() == $file_uid[0]['target_id']) { - return AccessResult::allowed(); + return AccessResult::allowed()->addCacheableDependency($account); } return AccessResult::forbidden(); } @@ -91,7 +91,8 @@ protected function checkFieldAccess($operation, FieldDefinitionInterface $field_ * {@inheritdoc} */ protected function checkCreateAccess(AccountInterface $account, array $context, $entity_bundle = NULL) { - // @todo Remove this override after https://www.drupal.org/node/2310307 is fixed. + // @todo Remove this override after https://www.drupal.org/node/2310307 is + // fixed. return AccessResult::allowed(); } diff --git a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php index 2abdbf8..20cbf1d 100644 --- a/core/modules/hal/src/Normalizer/FileEntityNormalizer.php +++ b/core/modules/hal/src/Normalizer/FileEntityNormalizer.php @@ -70,7 +70,7 @@ public function denormalize($data, $class, $format = NULL, array $context = arra $entity->setFileUri($uri); } else { - throw new RuntimeException('failed to write ' . $entity->getFilename()); + throw new RuntimeException('Failed to write ' . $entity->getFilename()); } } diff --git a/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php b/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php index 6f8632e..1d17a7c 100644 --- a/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php +++ b/core/modules/hal/tests/src/Kernel/EntityNormalizeTest.php @@ -241,4 +241,5 @@ public function testFile() { $this->assertEquals($field_values, $denormalized_file->get($field_name)->getValue()); } } + } diff --git a/core/modules/hal/tests/src/Kernel/FileFieldNormalizeTest.php b/core/modules/hal/tests/src/Kernel/FileFieldNormalizeTest.php index 4a54913..4f4b317 100644 --- a/core/modules/hal/tests/src/Kernel/FileFieldNormalizeTest.php +++ b/core/modules/hal/tests/src/Kernel/FileFieldNormalizeTest.php @@ -17,14 +17,7 @@ class FileFieldNormalizeTest extends NormalizerTestBase { /** * {@inheritdoc} */ - public static $modules = [ - 'entity_test', - 'field', - 'image', - 'hal', - 'system', - 'file', - ]; + public static $modules = ['entity_test', 'field', 'image', 'hal', 'system', 'file']; /** * {@inheritdoc} diff --git a/core/modules/serialization/src/Tests/NormalizerTestBase.php b/core/modules/serialization/src/Tests/NormalizerTestBase.php index c2a2ab3..fc272f7 100644 --- a/core/modules/serialization/src/Tests/NormalizerTestBase.php +++ b/core/modules/serialization/src/Tests/NormalizerTestBase.php @@ -3,7 +3,6 @@ namespace Drupal\serialization\Tests; use Drupal\KernelTests\KernelTestBase; -use Drupal\hal\Normalizer\FileEntityNormalizer; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig;