Skip to content

Commit f86e421

Browse files
🔃 [Magento Community Engineering] Community Contributions - 2.2-develop
Accepted Public Pull Requests: - #22873: [Backport] #22786 Add dependency for UPS required fields to avoid validation for these fields if UPS Shipping is not active (by @serhiyzhovnir) - #22180: [Backport] Resolved undefined index issue for import adapter (by @amol2jcommerce) Fixed GitHub Issues: - #22786: The validation for UPS configurations triggers even if UPS is disabled for checkout (reported by @serhiyzhovnir) has been fixed in #22873 by @serhiyzhovnir in 2.2-develop branch Related commits: 1. d4553a2 2. 3ccf72b - #19761: Custom import adapter data validation issue (reported by @jaimin-ktpl) has been fixed in #22180 by @amol2jcommerce in 2.2-develop branch Related commits: 1. d23dd1e 2. 60034d5
2 parents 947ed0d + 0c12792 commit f86e421

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

app/code/Magento/ImportExport/Model/Import/Entity/AbstractEntity.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ protected function _saveValidatedBunches()
408408
if ($source->valid()) {
409409
try {
410410
$rowData = $source->current();
411-
$skuSet[$rowData['sku']] = true;
411+
if (array_key_exists('sku', $rowData)) {
412+
$skuSet[$rowData['sku']] = true;
413+
}
412414
} catch (\InvalidArgumentException $e) {
413415
$this->addRowError($e->getMessage(), $this->_processedRowsCount);
414416
$this->_processedRowsCount++;
@@ -436,7 +438,7 @@ protected function _saveValidatedBunches()
436438
$source->next();
437439
}
438440
}
439-
$this->_processedEntitiesCount = count($skuSet);
441+
$this->_processedEntitiesCount = (count($skuSet)) ? : $this->_processedRowsCount;
440442

441443
return $this;
442444
}

app/code/Magento/Ups/etc/adminhtml/system.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
<field id="access_license_number" translate="label" type="obscure" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
1414
<label>Access License Number</label>
1515
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
16+
<depends>
17+
<field id="carriers/ups/active">1</field>
18+
</depends>
1619
</field>
1720
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
1821
<label>Enabled for Checkout</label>
@@ -84,6 +87,9 @@
8487
<field id="password" translate="label" type="obscure" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
8588
<label>Password</label>
8689
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
90+
<depends>
91+
<field id="carriers/ups/active">1</field>
92+
</depends>
8793
</field>
8894
<field id="pickup" translate="label" type="select" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
8995
<label>Pickup Method</label>
@@ -113,6 +119,9 @@
113119
<field id="username" translate="label" type="obscure" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
114120
<label>User ID</label>
115121
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
122+
<depends>
123+
<field id="carriers/ups/active">1</field>
124+
</depends>
116125
</field>
117126
<field id="negotiated_active" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
118127
<label>Enable Negotiated Rates</label>

0 commit comments

Comments
 (0)