only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/ContentEntityBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityBase.php @@ -1094,7 +1094,7 @@ public function __clone() { // Ensure that the following properties are actually cloned by // overwriting the original references with ones pointing to copies of - // them: enforceIsNew, newRevision, loadedRevisionId and fields. + // them: enforceIsNew, newRevision, loadedRevisionId, fields and entityKeys. $enforce_is_new = $this->enforceIsNew; $this->enforceIsNew = &$enforce_is_new; @@ -1107,6 +1107,9 @@ public function __clone() { $fields = $this->fields; $this->fields = &$fields; + $entity_keys = $this->entityKeys; + $this->entityKeys = &$entity_keys; + foreach ($this->fields as $name => $values) { $this->fields[$name] = []; // Untranslatable fields may have multiple references for the same field