From 0db130e59f77ac57a80d8433f19b4062c575c152 Mon Sep 17 00:00:00 2001 From: k-yamamura Date: Wed, 13 Jul 2022 12:39:04 +0900 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81CSV=E7=99=BB=E9=8C=B2?= =?UTF-8?q?=E3=81=A7=E5=95=86=E5=93=81=E3=82=B3=E3=83=BC=E3=83=89=E3=81=AE?= =?UTF-8?q?=E9=A0=85=E7=9B=AE=E3=81=8C=E3=81=AA=E3=81=91=E3=82=8C=E3=81=B0?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E3=82=92=E7=84=A1=E8=A6=96=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Product/CsvImportController.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Eccube/Controller/Admin/Product/CsvImportController.php b/src/Eccube/Controller/Admin/Product/CsvImportController.php index 24c6b387c14..71b271c5ea7 100644 --- a/src/Eccube/Controller/Admin/Product/CsvImportController.php +++ b/src/Eccube/Controller/Admin/Product/CsvImportController.php @@ -1130,10 +1130,12 @@ protected function createProductClass($row, Product $Product, $data, $headerByKe } } - if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) { - $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); - } else { - $ProductClass->setCode(null); + if (isset($row[$headerByKey['product_code']])) { + if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) { + $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); + } else { + $ProductClass->setCode(null); + } } if (!isset($row[$headerByKey['stock_unlimited']]) @@ -1308,10 +1310,12 @@ protected function updateProductClass($row, Product $Product, ProductClass $Prod } } - if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) { - $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); - } else { - $ProductClass->setCode(null); + if (isset($row[$headerByKey['product_code']])) { + if (StringUtil::isNotBlank($row[$headerByKey['product_code']])) { + $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']])); + } else { + $ProductClass->setCode(null); + } } if (!isset($row[$headerByKey['stock_unlimited']])