diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index dbc47d2d43..3e0a3c206e 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -119,7 +119,9 @@ abstract class QBMapper { $qb->execute(); - $entity->setId((int) $qb->getLastInsertId()); + if($entity->getId() === null) { + $entity->setId((int)$qb->getLastInsertId()); + } return $entity; }