Skip to content

Commit 9a3a62a

Browse files
Contact/Contactgroup(From): Add value for external_uuid column on insert
1 parent 35cc044 commit 9a3a62a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

application/forms/ContactGroupForm.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use ipl\Web\Compat\CompatForm;
1818
use ipl\Web\FormElement\TermInput;
1919
use ipl\Web\FormElement\TermInput\Term;
20+
use Ramsey\Uuid\Uuid;
2021

2122
class ContactGroupForm extends CompatForm
2223
{
@@ -176,8 +177,9 @@ public function addGroup(): int
176177
$this->db->insert(
177178
'contactgroup',
178179
[
179-
'name' => trim($data['group_name']),
180-
'color' => '#000000'
180+
'name' => trim($data['group_name']),
181+
'external_uuid' => Uuid::uuid4()->toString(),
182+
'color' => '#000000'
181183
]
182184
);
183185

library/Notifications/Web/Form/ContactForm.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use ipl\Validator\EmailAddressValidator;
1919
use ipl\Web\Common\CsrfCounterMeasure;
2020
use ipl\Web\Compat\CompatForm;
21+
use Ramsey\Uuid\Uuid;
2122

2223
class ContactForm extends CompatForm
2324
{
@@ -198,6 +199,7 @@ public function addOrUpdateContact(): void
198199

199200
$addressFromDb = [];
200201
if ($this->contactId === null) {
202+
$contact['external_uuid'] = Uuid::uuid4()->toString();
201203
$this->db->insert('contact', $contact);
202204
$this->contactId = $this->db->lastInsertId();
203205
} else {

0 commit comments

Comments
 (0)