Commit 3b0a107e authored by Larisse Amorim's avatar Larisse Amorim Committed by Julian Pustkuchen
Browse files

Issue #3270757 by larisse, Anybody, Grevil: Remove media_entity code from >=3.1

parent 4063a03a
Loading
Loading
Loading
Loading
+1 −2
Changes for src/ImageDTO.php: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
namespace Drupal\photoswipe;

use Drupal\media\MediaInterface;
use Drupal\media_entity\MediaInterface as MediaEntityInterface;

/**
 * Contains image item.
@@ -99,7 +98,7 @@ class ImageDTO {
    $this->settings = $variables['display_settings'];
    // In case if entity is instance of Media use referenced field provided
    // specified by user.
    $this->item = (($item = $variables['item']) && ($item->entity instanceof MediaInterface || $item->entity instanceof MediaEntityInterface)) && $item->entity->hasField($this->settings['photoswipe_reference_image_field'])
    $this->item = (($item = $variables['item']) && ($item->entity instanceof MediaInterface)) && $item->entity->hasField($this->settings['photoswipe_reference_image_field'])
      ? $item->entity->get($this->settings['photoswipe_reference_image_field'])
      : $item;