From 75d72954e9045ee0358437329274c34b0575d59c Mon Sep 17 00:00:00 2001 From: Adam Pham Date: Wed, 14 Dec 2022 00:18:35 +0700 Subject: [PATCH] 36555: Magento Community Edition: Version 2.4.5 - Import Stock Sources Added Extra Column in Import CSV File, Validation message is not understandable to the end users [magento/magento2 repository] --- InventoryImportExport/Model/Import/Sources.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/InventoryImportExport/Model/Import/Sources.php b/InventoryImportExport/Model/Import/Sources.php index 4440eac4bc25..a0179c9f4f5e 100644 --- a/InventoryImportExport/Model/Import/Sources.php +++ b/InventoryImportExport/Model/Import/Sources.php @@ -31,6 +31,13 @@ class Sources extends AbstractEntity const COL_QTY = SourceItemInterface::QUANTITY; const COL_STATUS = SourceItemInterface::STATUS; + protected $validColumnNames = [ + self::COL_SKU, + self::COL_SOURCE_CODE, + self::COL_QTY, + self::COL_STATUS + ]; + /** * @var Json */ @@ -80,6 +87,10 @@ public function __construct( } } $this->commands = $commands; + + foreach ($this->errorMessageTemplates as $errorCode => $message) { + $this->getErrorAggregator()->addErrorMessageTemplate($errorCode, $message); + } } /**