Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pvhee/14801e0f82e06f51cb0d88b9d400cbd6 to your computer and use it in GitHub Desktop.
Save pvhee/14801e0f82e06f51cb0d88b9d400cbd6 to your computer and use it in GitHub Desktop.
PLAT-235_paragraph_constraint_violation.patch
diff --git a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
index b1fee2a..5f954c3 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityChangedConstraintValidator.php
@@ -16,7 +16,7 @@ class EntityChangedConstraintValidator extends ConstraintValidator {
public function validate($entity, Constraint $constraint) {
if (isset($entity)) {
/** @var \Drupal\Core\Entity\EntityInterface $entity */
- if (!$entity->isNew()) {
+ if (!$entity->isNew() && $entity->getEntityTypeId() != 'paragraph') {
$saved_entity = \Drupal::entityManager()->getStorage($entity->getEntityTypeId())->loadUnchanged($entity->id());
// A change to any other translation must add a violation to the current
// translation because there might be untranslatable shared fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment