X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FPlugin%2FValidation%2FConstraint%2FEntityUntranslatableFieldsConstraintValidator.php;fp=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FPlugin%2FValidation%2FConstraint%2FEntityUntranslatableFieldsConstraintValidator.php;h=730e5390cb5259dd1b14f22e93a19e797f6e67e0;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=5b1ad1f5c99591913d8e586ea2fae066d1d193e6;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraintValidator.php b/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraintValidator.php index 5b1ad1f5c..730e5390c 100644 --- a/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraintValidator.php +++ b/web/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraintValidator.php @@ -6,7 +6,6 @@ use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\Core\Entity\ContentEntityInterface; use Drupal\Core\Entity\EntityChangesDetectionTrait; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\Core\Field\ChangedFieldItemList; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; @@ -111,19 +110,9 @@ class EntityUntranslatableFieldsConstraintValidator extends ConstraintValidator continue; } - // When saving entities in the user interface, the changed timestamp is - // automatically incremented by ContentEntityForm::submitForm() even if - // nothing was actually changed. Thus, the changed time needs to be - // ignored when determining whether there are any actual changes in the - // entity. - $field = $entity->get($field_name); - if ($field instanceof ChangedFieldItemList) { - continue; - } - - $items = $field->filterEmptyItems(); + $items = $entity->get($field_name)->filterEmptyItems(); $original_items = $original->get($field_name)->filterEmptyItems(); - if (!$items->equals($original_items)) { + if ($items->hasAffectingChanges($original_items, $entity->getUntranslated()->language()->getId())) { return TRUE; } }