From 96928d9817bd4a1dd2aa7f1896e8f315b52ff499 Mon Sep 17 00:00:00 2001 From: Arthur de Moulins Date: Mon, 18 Nov 2024 15:28:14 +0100 Subject: [PATCH] fix secret update --- .../api/src/Controller/Admin/WorkspaceSecretCrudController.php | 2 ++ databox/api/src/Entity/Integration/WorkspaceSecret.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/databox/api/src/Controller/Admin/WorkspaceSecretCrudController.php b/databox/api/src/Controller/Admin/WorkspaceSecretCrudController.php index 57b05136f..d15492fc4 100644 --- a/databox/api/src/Controller/Admin/WorkspaceSecretCrudController.php +++ b/databox/api/src/Controller/Admin/WorkspaceSecretCrudController.php @@ -47,5 +47,7 @@ public function configureFields(string $pageName): iterable ->onlyOnForms(); yield DateTimeField::new('createdAt') ->hideOnForm(); + yield DateTimeField::new('updatedAt') + ->hideOnForm(); } } diff --git a/databox/api/src/Entity/Integration/WorkspaceSecret.php b/databox/api/src/Entity/Integration/WorkspaceSecret.php index 6133b42af..7b6eba227 100644 --- a/databox/api/src/Entity/Integration/WorkspaceSecret.php +++ b/databox/api/src/Entity/Integration/WorkspaceSecret.php @@ -63,5 +63,8 @@ public function getPlainValue(): ?string public function setPlainValue(?string $plainValue): void { $this->plainValue = $plainValue; + if (null !== $plainValue) { + $this->setValue(null); // Make a change to this mapped field trigger Doctrine preUpdate event + } } }