X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fimage%2Fsrc%2FPlugin%2FField%2FFieldType%2FImageItem.php;fp=web%2Fcore%2Fmodules%2Fimage%2Fsrc%2FPlugin%2FField%2FFieldType%2FImageItem.php;h=67a15a7d008423503dc03f081baf2ce7459642eb;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=9e58ccd70dbcb46d0b07899661d4629efa3aa0ee;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/web/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php b/web/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php index 9e58ccd70..67a15a7d0 100644 --- a/web/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php +++ b/web/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php @@ -344,8 +344,8 @@ class ImageItem extends FileItem { 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); - if ($path = $random->image(drupal_realpath($destination), $min_resolution, $max_resolution)) { + 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); $image->setOwnerId(\Drupal::currentUser()->id()); @@ -354,7 +354,7 @@ class ImageItem extends FileItem { $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 {