Skip to content

Commit 099ea6b

Browse files
committed
[BUGFIX] Solved error while upgrading from 2.1 to 2.2
1 parent 9ed7081 commit 099ea6b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/code/Magento/Tax/Setup/UpgradeData.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
8181
false
8282
);
8383
}
84-
if (version_compare($context->getVersion(), '2.0.2', '<')) {
84+
if (version_compare($context->getVersion(), '2.0.3', '<')) {
8585
//Update the tax_region_id
8686
$taxRateList = $this->taxRateRepository->getList($this->searchCriteriaFactory->create());
8787
/** @var \Magento\Tax\Api\Data\TaxRateInterface $taxRateData */
@@ -91,6 +91,9 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
9191
/** @var \Magento\Directory\Model\Region $region */
9292
$region = $this->directoryRegionFactory->create();
9393
$region->loadByCode($regionCode, $taxRateData->getTaxCountryId());
94+
if ($taxRateData->getTaxPostcode() === null) {
95+
$taxRateData->setTaxPostcode('*');
96+
}
9497
$taxRateData->setTaxRegionId($region->getRegionId());
9598
$this->taxRateRepository->save($taxRateData);
9699
}

app/code/Magento/Tax/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Tax" setup_version="2.0.2">
9+
<module name="Magento_Tax" setup_version="2.0.3">
1010
<sequence>
1111
<module name="Magento_Catalog"/>
1212
<module name="Magento_Checkout"/>

0 commit comments

Comments
 (0)