From 0c671f71aef4a9e2800f4730843e17f3b8bc7e5c Mon Sep 17 00:00:00 2001 From: ryuring Date: Mon, 25 Nov 2024 18:39:43 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3=E3=83=84?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E8=AA=AD=E3=81=BF=E8=BE=BC=E3=81=BF?= =?UTF-8?q?=E3=81=AE=E9=9A=9B=E3=81=AB=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=A8?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/Component/BcDbMigrator5Component.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Controller/Component/BcDbMigrator5Component.php b/src/Controller/Component/BcDbMigrator5Component.php index 2f9cf1c..6a22e39 100755 --- a/src/Controller/Component/BcDbMigrator5Component.php +++ b/src/Controller/Component/BcDbMigrator5Component.php @@ -252,6 +252,7 @@ protected function _updateContent() $records = $this->readCsv('contents'); $table = $this->tableLocator->get('BaserCore.Contents'); $table->removeBehavior('Tree'); + BcUtil::offEvent($table->getEventManager(), 'Model.beforeMarshal'); BcUtil::offEvent($table->getEventManager(), 'Model.afterSave'); foreach($records as $record) { $record['site_id'] = $this->getSiteId($record['site_id']); @@ -276,11 +277,7 @@ protected function _updateContent() try { $entity = $table->newEmptyEntity(); $entity->setAccess('id', true); - if(!$record['parent_id']) { - $entity = $table->patchEntity($entity, $record, ['validate' => false]); - } else { - $entity = $table->patchEntity($entity, $record, ['validate' => false]); - } + $entity = $table->patchEntity($entity, $record, ['validate' => false]); $table->saveOrFail($entity); } catch (PersistenceException $e) { $this->log('contents: ' . $e->getEntity()->getMessage(), LogLevel::ERROR, 'migrate_db');