Skip to content

Commit

Permalink
MAGETWO-82746: [BUGFIX] Solved error while upgrading from 2.1 to 2.2 #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksii Korshenko committed Nov 29, 2017
2 parents 739a9b6 + 6a3db7a commit c6f8bab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/code/Magento/Tax/Setup/UpgradeData.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
false
);
}
if (version_compare($context->getVersion(), '2.0.2', '<')) {
if (version_compare($context->getVersion(), '2.0.3', '<')) {
//Update the tax_region_id
$taxRateList = $this->taxRateRepository->getList($this->searchCriteriaFactory->create());
/** @var \Magento\Tax\Api\Data\TaxRateInterface $taxRateData */
Expand All @@ -91,6 +91,9 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
/** @var \Magento\Directory\Model\Region $region */
$region = $this->directoryRegionFactory->create();
$region->loadByCode($regionCode, $taxRateData->getTaxCountryId());
if ($taxRateData->getTaxPostcode() === null) {
$taxRateData->setTaxPostcode('*');
}
$taxRateData->setTaxRegionId($region->getRegionId());
$this->taxRateRepository->save($taxRateData);
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Tax/etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Tax" setup_version="2.0.2">
<module name="Magento_Tax" setup_version="2.0.3">
<sequence>
<module name="Magento_Catalog"/>
<module name="Magento_Checkout"/>
Expand Down

0 comments on commit c6f8bab

Please sign in to comment.