-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Upgrade to Magento 2.2.5 with patches in place. Area code is not set in Magento_Sales fillQuoteAddressIdInSalesOrderAddress #17434
Copy link
Copy link
Closed
Labels
Component: SalesIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Activity
Metadata
Metadata
Assignees
Labels
Component: SalesIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Preconditions
Steps to reproduce
composer update -vvvphp bin/magento setup:upgradeUpgradeData.php, functionfillQuoteAddressIdInSalesOrderAddress()throws an errorArea code is not set.Expected result
Actual result
php bin/magento setup:upgradefailsI guess I've been doing the upgrade slightly differently.
I run
php bin/magento setup:upgradeafter applying the 2 patches.In future releases, upgrading from a previous Magento 2 version could fail because of this error.
The error is triggered in
vendor/magento/framework/Session/SidResolver.php, function getSid():Even if fillQuoteAddressIdInSalesOrderAddress is called in an emulated area with area code set:
it stills fails because in Magento\Framework\Session\SidResolver $this->appState is a Magento style "singleton"/shared class:
$this->appState = $appState ?: \Magento\Framework\App\ObjectManager::getInstance()->get(State::class);where in
UpgradeData.php, $this->state is a new instance of the same class.Area code is not seen in $this->appState from SidResolver class.
I guess the fix is something like:
in
__construct(),vendor/magento/module-sales/Setup/UpgradeData.php.Or declare the
stateparameter as shared in di.xml, arguments of UpgradeData.php.This works for me. I am not assuming it is a perfect solution that does not has the potential to impact the other Magento 2 modules setup upgrade.