diff --git a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php index 14335d8ecec236c0267d7ed518e546e2d3ff8082..67a15a7d008423503dc03f081baf2ce7459642eb 100644 --- a/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php +++ b/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php @@ -344,7 +344,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin if (!isset($images[$extension][$min_resolution][$max_resolution]) || count($images[$extension][$min_resolution][$max_resolution]) <= 5) { $tmp_file = drupal_tempnam('temporary://', 'generateImage_'); $destination = $tmp_file . '.' . $extension; - file_unmanaged_move($tmp_file, $destination, FILE_CREATE_DIRECTORY); + file_unmanaged_move($tmp_file, $destination); if ($path = $random->image(\Drupal::service('file_system')->realpath($destination), $min_resolution, $max_resolution)) { $image = File::create(); $image->setFileUri($path); @@ -354,7 +354,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin $destination_dir = static::doGetUploadLocation($settings); file_prepare_directory($destination_dir, FILE_CREATE_DIRECTORY); $destination = $destination_dir . '/' . basename($path); - $file = file_move($image, $destination, FILE_CREATE_DIRECTORY); + $file = file_move($image, $destination); $images[$extension][$min_resolution][$max_resolution][$file->id()] = $file; } else {