Issue #3027574 by tuutti: SqlContentEntityStorage no longer update entities with certain (id) fields

8.7.x
Alex Pott 2019-01-23 09:38:10 +00:00
parent 55ce9ce3a7
commit 819a788ebd
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
1 changed files with 2 additions and 1 deletions

View File

@ -824,13 +824,14 @@ class SqlContentEntityStorage extends ContentEntityStorageBase implements SqlEnt
if ($update) {
$default_revision = $entity->isDefaultRevision();
if ($default_revision) {
$id = $record->{$this->idKey};
// Remove the ID from the record to enable updates on SQL variants
// that prevent updating serial columns, for example, mssql.
unset($record->{$this->idKey});
$this->database
->update($this->baseTable)
->fields((array) $record)
->condition($this->idKey, $entity->get($this->idKey)->value)
->condition($this->idKey, $id)
->execute();
}
if ($this->revisionTable) {