Commit 45c95907 authored by Pashupathi Nath Gajawada's avatar Pashupathi Nath Gajawada Committed by Youri van Koppen
Browse files

Issue #2704777 by Pashupathi Nath Gajawada, MegaChriz: Replace deprecated...

Issue #2704777 by Pashupathi Nath Gajawada, MegaChriz: Replace deprecated usage of entity_create('file') with a direct call.
parent 719613e2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
namespace Drupal\feeds;

use Drupal\Component\Utility\SafeMarkup;
use Drupal\file\Entity\File;

/**
 * Enclosure element, can be part of the result array.
@@ -115,7 +116,7 @@ class FeedsEnclosure {
    file_prepare_directory($destination, FILE_MODIFY_PERMISSIONS | FILE_CREATE_DIRECTORY);
    // Copy or save file depending on whether it is remote or local.
    if (drupal_realpath($this->uri)) {
      $file = entity_create('file', [
      $file = File::create([
        'uid' => 0,
        'uri' => $this->uri,
        'filemime' => $this->mimeType,