summaryrefslogtreecommitdiffstats
path: root/lib/Db/Item.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Db/Item.php')
-rw-r--r--lib/Db/Item.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Db/Item.php b/lib/Db/Item.php
index 2ead77066..693b9417c 100644
--- a/lib/Db/Item.php
+++ b/lib/Db/Item.php
@@ -99,6 +99,13 @@ class Item extends Entity implements IAPI, \JsonSerializable
public function __clone()
{
+ $this->setId(null);
+
+ /**
+ * Removes 'id' from updatedFields; this will avoid explicitly
+ * inserting the value NULL into the DB, and will instead allow a new
+ * id to be generated.
+ * */
$this->resetUpdatedFields();
$this->markFieldUpdated('contentHash');
$this->markFieldUpdated('guidHash');