diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Db/Item.php | 7 | ||||
-rw-r--r-- | lib/Service/ShareService.php | 1 |
2 files changed, 7 insertions, 1 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'); diff --git a/lib/Service/ShareService.php b/lib/Service/ShareService.php index 17db4e53b..552e1d9a4 100644 --- a/lib/Service/ShareService.php +++ b/lib/Service/ShareService.php @@ -110,7 +110,6 @@ class ShareService // Duplicate item & initialize fields $sharedItem = clone $item; - $sharedItem->setId(null); $sharedItem->setUnread(true); $sharedItem->setStarred(false); $sharedItem->setSharedBy($userId); |