summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/public/AppFramework/Db/QBMapper.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php
index dbc47d2d43d..3e0a3c206e7 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;
}