From 89c88b78e1b492bdc0e6c0ab8c542e08d745df79 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Wed, 25 Jan 2023 16:59:33 +0100 Subject: [PATCH 1/3] Clear ObjectEntity from Entity Manager --- Service/InstallationService.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Service/InstallationService.php b/Service/InstallationService.php index e7fc9bfb..581063e1 100644 --- a/Service/InstallationService.php +++ b/Service/InstallationService.php @@ -548,6 +548,7 @@ private function saveOnFixedId(ObjectEntity $objectEntity, array $hydrate = []): $objectEntity->setId($id); $this->em->persist($objectEntity); $this->em->flush(); + $this->em->clear(get_class($objectEntity)); $objectEntity = $this->em->getRepository('App:ObjectEntity')->findOneBy(['id' => $id]); $this->io->writeln(['Defintive object id ('.$objectEntity->getId().')']); From bf7d9f3d9d4e2cd8c49a92fdbf0c4c77bbc94dd9 Mon Sep 17 00:00:00 2001 From: Barry Brands Date: Wed, 25 Jan 2023 21:42:03 +0100 Subject: [PATCH 2/3] fix for executing installationService->install --- Command/InstallCommand.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Command/InstallCommand.php b/Command/InstallCommand.php index 3e5a9eb3..bd88c0f9 100644 --- a/Command/InstallCommand.php +++ b/Command/InstallCommand.php @@ -37,12 +37,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int { $this->installationService->setStyle(new SymfonyStyle($input, $output)); - $bundle = $input->getArgument('bundle'); - $data = $input->getArgument('data'); - $noSchema = $input->getOption('schema'); - $script = $input->getOption('script'); - $unsafe = $input->getOption('unsafe'); - - return $this->installationService->install($bundle, $noSchema); + return $this->installationService->install($input->getArgument('bundle'), [ + 'data' => $input->getArgument('data'), + 'noSchema' => $input->getOption('schema'), + 'script' => $input->getOption('script'), + 'unsafe' => $input->getOption('unsafe') + ]); } } From 0edc00239399bfa89d7bda70302d532a441639cf Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 25 Jan 2023 20:43:28 +0000 Subject: [PATCH 3/3] Apply fixes from StyleCI --- Command/InstallCommand.php | 6 +++--- Service/RequestService.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Command/InstallCommand.php b/Command/InstallCommand.php index bd88c0f9..97b13a28 100644 --- a/Command/InstallCommand.php +++ b/Command/InstallCommand.php @@ -38,10 +38,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->installationService->setStyle(new SymfonyStyle($input, $output)); return $this->installationService->install($input->getArgument('bundle'), [ - 'data' => $input->getArgument('data'), + 'data' => $input->getArgument('data'), 'noSchema' => $input->getOption('schema'), - 'script' => $input->getOption('script'), - 'unsafe' => $input->getOption('unsafe') + 'script' => $input->getOption('script'), + 'unsafe' => $input->getOption('unsafe'), ]); } } diff --git a/Service/RequestService.php b/Service/RequestService.php index faee996d..a8a75105 100644 --- a/Service/RequestService.php +++ b/Service/RequestService.php @@ -443,7 +443,7 @@ public function requestHandler(array $data, array $configuration): Response $responseLog = new Response(is_string($this->content) || is_null($this->content) ? $this->content : null, 200, ['CoreBundle' => 'GetItem']); $session = new Session(); $session->set('object', $this->id); - + // todo: This log is needed so we know an user has 'read' this object $this->logService->saveLog($this->logService->makeRequest(), $responseLog, 15, is_array($this->content) ? json_encode($this->content) : $this->content); } else {