1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

If not contacts array is passed, do no attempt to modify / save contacts

This commit is contained in:
David Bomba 2023-01-24 07:42:15 +11:00
parent df6e9bc9b8
commit 5ae52c5a91

View File

@ -102,7 +102,9 @@ class ClientRepository extends BaseRepository
$data['name'] = $client->present()->name(); $data['name'] = $client->present()->name();
} }
if(array_key_exists('contacts', $contact_data)) //24-01-2023 when a logo is uploaded, no other data is set, so we need to catch here and not update
//the contacts array UNLESS there are no contacts and we need to maintain state.
if(array_key_exists('contacts', $contact_data) || $client->contacts()->count() == 0)
$this->contact_repo->save($contact_data, $client); $this->contact_repo->save($contact_data, $client);
return $client; return $client;