From c302c3441ba6efef87177d2aaf205f278cf290c7 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Mon, 8 Jun 2026 10:30:37 +0200 Subject: [PATCH] =?UTF-8?q?fix(commercial)=20:=20aligner=20M1=20sur=20M2?= =?UTF-8?q?=20=E2=80=94=20message=20competitors=20explicite=20+=20reset=20?= =?UTF-8?q?memoisation=20ClientProcessor=20(ERP-86/87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Module/Commercial/Domain/Entity/Client.php | 2 +- .../ApiPlatform/State/Processor/ClientProcessor.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Module/Commercial/Domain/Entity/Client.php b/src/Module/Commercial/Domain/Entity/Client.php index 69e6b39..387f94f 100644 --- a/src/Module/Commercial/Domain/Entity/Client.php +++ b/src/Module/Commercial/Domain/Entity/Client.php @@ -188,7 +188,7 @@ class Client implements TimestampableInterface, BlamableInterface private ?string $description = null; #[ORM\Column(length: 255, nullable: true)] - #[Assert\Length(max: 255, maxMessage: 'Ce champ ne peut dépasser {{ limit }} caractères.', normalizer: 'trim')] + #[Assert\Length(max: 255, maxMessage: 'La liste des concurrents ne peut dépasser {{ limit }} caractères.', normalizer: 'trim')] #[Groups(['client:read', 'client:write:information'])] private ?string $competitors = null; diff --git a/src/Module/Commercial/Infrastructure/ApiPlatform/State/Processor/ClientProcessor.php b/src/Module/Commercial/Infrastructure/ApiPlatform/State/Processor/ClientProcessor.php index e451ee7..976ec6f 100644 --- a/src/Module/Commercial/Infrastructure/ApiPlatform/State/Processor/ClientProcessor.php +++ b/src/Module/Commercial/Infrastructure/ApiPlatform/State/Processor/ClientProcessor.php @@ -121,6 +121,12 @@ final class ClientProcessor implements ProcessorInterface return $this->persistProcessor->process($data, $operation, $uriVariables, $context); } + // Reinitialisation de la memoisation du payload en debut de traitement : + // le service est partage (stateful), on repart du corps de LA requete + // courante et on n'herite jamais des cles decodees d'une requete passee. + $this->decodedContent = null; + $this->decodedPayloadKeys = []; + $writableKeys = $this->writablePayloadKeys(); $isArchiveRequest = $this->guardArchive($data, $writableKeys);