Skip to content

Commit 0f6b12c

Browse files
committed
ACP2E-2129: customer is reporting their table rates are not updating via CSV any longer
- added unit tests
1 parent 39badd6 commit 0f6b12c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/code/Magento/OfflineShipping/Model/ResourceModel/Carrier/Tablerate.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,19 @@ public function uploadAndImport(\Magento\Framework\DataObject $object)
298298
} else {
299299
$request = $this->requestFactory->create();
300300
$files = (array)$request->getFiles();
301+
301302
if (empty($files['groups']['tablerate']['fields']['import']['value'])) {
302303
return $this;
303304
} else {
304305
$filePath = $files['groups']['tablerate']['fields']['import']['value']['tmp_name'];
305306
}
306307
}
308+
if (!$filePath) {
309+
return $this;
310+
}
307311

308312
$websiteId = $this->storeManager->getWebsite($object->getScopeId())->getId();
309313
$conditionName = $this->getConditionName($object);
310-
311314
$file = $this->getCsvFile($filePath);
312315
try {
313316
// delete old data by website and condition name

app/code/Magento/OfflineShipping/Test/Unit/Model/ResourceModel/Carrier/TablerateTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Magento\Framework\App\DeploymentConfig;
1212
use Magento\Framework\App\Request\Http;
1313
use Magento\Framework\App\RequestFactory;
14-
use Magento\Framework\App\RequestInterface;
1514
use Magento\Framework\App\ResourceConnection;
1615
use Magento\Framework\DB\Adapter\AdapterInterface;
1716
use Magento\Framework\Filesystem;

0 commit comments

Comments
 (0)