Skip to content

Commit 72418c7

Browse files
Merge pull request #4421 from FengZh61/Fix-the-problem-of-abnormal-values-of-item_key-and-created_at-in-item-attributes
Fix the problem of abnormal values of item key and created at in item attributes
2 parents 5a5e6be + a65245a commit 72418c7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

sources/import.queries.php

+4
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@
377377
'login' => empty($item['login']) === true ? '' : substr($item['login'], 0, 200),
378378
'anyone_can_modify' => $post_edit_all,
379379
'encryption_type' => 'teampass_aes',
380+
'item_key' => uniqidReal(50),
381+
'created_at' => time(),
380382
)
381383
);
382384
$newId = DB::insertId();
@@ -816,6 +818,8 @@ function handleGroups($groups, string $previousFolder, array $newItemsToAdd, int
816818
'inactif' => 0,
817819
'restricted_to' => '',
818820
'perso' => $post_folders[$item['parentFolderId']]['isPF'] === true ? 1 : 0,
821+
'item_key' => uniqidReal(50),
822+
'created_at' => time(),
819823
)
820824
);
821825
$newId = DB::insertId();

sources/items.queries.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -2251,8 +2251,9 @@
22512251

22522252
// generate the query to update the new record with the previous values
22532253
$aSet = array();
2254-
$aSet['created_at'] = time();
22552254
foreach ($originalRecord as $key => $value) {
2255+
$aSet['item_key'] = uniqidReal(50);
2256+
$aSet['created_at'] = time();
22562257
if ($key === 'id_tree') {
22572258
$aSet['id_tree'] = $post_dest_id;
22582259
} elseif ($key === 'label') {

0 commit comments

Comments
 (0)