diff --git a/core/lib/Drupal/Core/Entity/Entity.php b/core/lib/Drupal/Core/Entity/Entity.php index 785c81c..1eb7c23 100644 --- a/core/lib/Drupal/Core/Entity/Entity.php +++ b/core/lib/Drupal/Core/Entity/Entity.php @@ -331,6 +331,10 @@ public function getTranslationLanguages($include_default = TRUE) { * Implements \Drupal\Core\Entity\EntityInterface::save(). */ public function save() { + // Entities that are not new must have UUIDs. + if (!$this->isNew() && !$this->uuid()) { + throw new EntityMalformedException('Only new entities can be saved without a UUID.'); + } return drupal_container()->get('plugin.manager.entity')->getStorageController($this->entityType)->save($this); }