Skip to content

Commit 89d949d

Browse files
committed
[BUGFIX] Solved error while upgrading from 2.1 to 2.2
Given error while running setup:upgrade: `postcode is a required field` Problem is solved by setting tax_postcode to * if it was NULL
1 parent 4d26093 commit 89d949d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

0 commit comments

Comments
 (0)