Update to Drupal 8.0-dev-2015-11-17. Commits through da81cd220, Tue Nov 17 15:53:49 2015 +0000, Issue #2617224 by Wim Leers: Move around/fix some documentation.
This commit is contained in:
parent
4afb23bbd3
commit
7784f4c23d
929 changed files with 19798 additions and 5304 deletions
|
@ -43,7 +43,7 @@ use Drupal\file\Plugin\Field\FieldType\FileItem;
|
|||
* },
|
||||
* },
|
||||
* list_class = "\Drupal\file\Plugin\Field\FieldType\FileFieldItemList",
|
||||
* constraints = {"ValidReference" = {}, "ReferenceAccess" = {}}
|
||||
* constraints = {"ReferenceAccess" = {}, "FileValidation" = {}}
|
||||
* )
|
||||
*/
|
||||
class ImageItem extends FileItem {
|
||||
|
@ -346,10 +346,10 @@ class ImageItem extends FileItem {
|
|||
if ($path = $random->image(drupal_realpath($destination), $min_resolution, $max_resolution)) {
|
||||
$image = File::create();
|
||||
$image->setFileUri($path);
|
||||
// $image->setOwner($account);
|
||||
$image->setOwnerId(\Drupal::currentUser()->id());
|
||||
$image->setMimeType('image/' . pathinfo($path, PATHINFO_EXTENSION));
|
||||
$image->setFileName(drupal_basename($path));
|
||||
$destination_dir = $settings['uri_scheme'] . '://' . $settings['file_directory'];
|
||||
$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);
|
||||
|
|
Reference in a new issue