mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Fix import of contact on already existing contacts
This commit is contained in:
parent
aa4e528778
commit
cc1a85f030
1 changed files with 20 additions and 6 deletions
|
@ -162,10 +162,17 @@ namespace controllers\internals;
|
|||
}
|
||||
$datas = json_encode($datas);
|
||||
|
||||
$success = $this->create($id_user, $line['number'], $line['name'], $datas);
|
||||
if ($success)
|
||||
try
|
||||
{
|
||||
++$nb_insert;
|
||||
$success = $this->create($id_user, $line['number'], $line['name'], $datas);
|
||||
if ($success)
|
||||
{
|
||||
++$nb_insert;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -218,10 +225,17 @@ namespace controllers\internals;
|
|||
$datas = $contact['datas'] ?? [];
|
||||
$datas = json_encode($datas);
|
||||
|
||||
$success = $this->create($id_user, $contact['number'], $contact['name'], $datas);
|
||||
if ($success)
|
||||
try
|
||||
{
|
||||
++$nb_insert;
|
||||
$success = $this->create($id_user, $contact['number'], $contact['name'], $datas);
|
||||
if ($success)
|
||||
{
|
||||
++$nb_insert;
|
||||
}
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue