From 13c94df096a7dbe620186cfd99d0e6acb31f6d7d Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Thu, 20 Jul 2017 16:00:30 +0200 Subject: [PATCH] Issue #2894112 by tstoeckler: Media::hasSourceFieldChanged() must use FieldItemList::equals() --- core/modules/media/src/Entity/Media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/media/src/Entity/Media.php b/core/modules/media/src/Entity/Media.php index 5d68bdd50577..d175572450c3 100644 --- a/core/modules/media/src/Entity/Media.php +++ b/core/modules/media/src/Entity/Media.php @@ -249,8 +249,8 @@ class Media extends EditorialContentEntityBase implements MediaInterface { */ protected function hasSourceFieldChanged() { $source_field_name = $this->getSource()->getConfiguration()['source_field']; - $current_value = $this->get($source_field_name)->getValue(); - return (isset($this->original) && $current_value != $this->original->get($source_field_name)->getValue()); + $current_items = $this->get($source_field_name); + return isset($this->original) && !$current_items->equals($this->original->get($source_field_name)); } /**