Skip to content

Commit

Permalink
管理画面側の会員登録時に、dtb_customer_addressに住所情報が登録されない。EC-CUBE#678
Browse files Browse the repository at this point in the history
編集時にdtb_customer_addressにデータが追加されていくバグ修正
dtb_customer_addressに対する操作は新規登録時のみで更新は行わない
  • Loading branch information
migarashi committed Aug 27, 2015
1 parent 8f3d0d9 commit 198bcba
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/Eccube/Controller/Admin/Customer/CustomerEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public function index(Application $app, Request $request, $id = null)
$Customer->setPassword($app['config']['default_password']);
// 新規登録
} else {
$Customer = $app['eccube.repository.customer']->newCustomer();
$Customer = $app['eccube.repository.customer']->newCustomer();
$CustomerAddress = new \Eccube\Entity\CustomerAddress();
}

// 会員登録フォーム
Expand All @@ -70,6 +71,27 @@ public function index(Application $app, Request $request, $id = null)
->getRepository('Eccube\Entity\Customer')
->getUniqueSecretKey($app)
);

$CustomerAddress->setName01($Customer->getName01())
->setName02($Customer->getName02())
->setKana01($Customer->getKana01())
->setKana02($Customer->getKana02())
->setCompanyName($Customer->getCompanyName())
->setZip01($Customer->getZip01())
->setZip02($Customer->getZip02())
->setZipcode($Customer->getZip01() . $Customer->getZip02())
->setPref($Customer->getPref())
->setAddr01($Customer->getAddr01())
->setAddr02($Customer->getAddr02())
->setTel01($Customer->getTel01())
->setTel02($Customer->getTel02())
->setTel03($Customer->getTel03())
->setFax01($Customer->getFax01())
->setFax02($Customer->getFax02())
->setFax03($Customer->getFax03())
->setDelFlg(Constant::DISABLED)
->setCustomer($Customer);
$app['orm.em']->persist($CustomerAddress);
}

if ($Customer->getPassword() === $app['config']['default_password']) {
Expand All @@ -82,29 +104,7 @@ public function index(Application $app, Request $request, $id = null)
);
}

$CustomerAddress = new \Eccube\Entity\CustomerAddress();
$CustomerAddress->setName01($Customer->getName01())
->setName02($Customer->getName02())
->setKana01($Customer->getKana01())
->setKana02($Customer->getKana02())
->setCompanyName($Customer->getCompanyName())
->setZip01($Customer->getZip01())
->setZip02($Customer->getZip02())
->setZipcode($Customer->getZip01() . $Customer->getZip02())
->setPref($Customer->getPref())
->setAddr01($Customer->getAddr01())
->setAddr02($Customer->getAddr02())
->setTel01($Customer->getTel01())
->setTel02($Customer->getTel02())
->setTel03($Customer->getTel03())
->setFax01($Customer->getFax01())
->setFax02($Customer->getFax02())
->setFax03($Customer->getFax03())
->setDelFlg(Constant::DISABLED)
->setCustomer($Customer);

$app['orm.em']->persist($Customer);
$app['orm.em']->persist($CustomerAddress);
$app['orm.em']->flush();

$app->addSuccess('admin.customer.save.complete', 'admin');
Expand Down

0 comments on commit 198bcba

Please sign in to comment.