From 159496c0f292fc2732544a2288a27a9f6bd4688c Mon Sep 17 00:00:00 2001 From: Chihiro Adachi <8196725+chihiro-adachi@users.noreply.github.com> Date: Wed, 23 Dec 2020 11:14:47 +0900 Subject: [PATCH] =?UTF-8?q?ManyToOne=E3=81=AE=E5=87=BA=E5=8A=9B=E3=81=8C?= =?UTF-8?q?=E4=B8=8D=E5=AE=8C=E5=85=A8=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=9F?= =?UTF-8?q?=E3=82=81=E3=80=81detach=E3=82=92=E4=BD=BF=E3=81=86=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Eccube/Service/CsvExportService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Eccube/Service/CsvExportService.php b/src/Eccube/Service/CsvExportService.php index 357ca77faed..9b1c533e41b 100644 --- a/src/Eccube/Service/CsvExportService.php +++ b/src/Eccube/Service/CsvExportService.php @@ -282,7 +282,9 @@ public function exportData(\Closure $closure) $query = $this->qb->getQuery(); foreach ($query->getResult() as $iterableResult) { $closure($iterableResult, $this); - $this->entityManager->clear(); + // https://github.com/EC-CUBE/ec-cube/issues/4775 + // entityManager::detach内のtrigger errorを避けるため、UnitOfWork::detachを直接呼び出す + $this->entityManager->getUnitOfWork()->detach(); $query->free(); flush(); }