-
Couldn't load subscription status.
- Fork 9.4k
Description
Preconditions and environment
- Magento version - 2.4.4 and upto 2.4.9-alpha2
Steps to reproduce
Calling toOptionArray($isActiveOnlyFlag = false) with argument true still loads the Factories of all Shipping methods which consume unnecessary load time.
Following code loads the factory of all shipping methods:
https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Shipping/Model/Config.php#L95
Expected result
Calling toOptionArray($isActiveOnlyFlag = false) with argument true should only load the factories of active shipping methods.
Actual result
Calling toOptionArray($isActiveOnlyFlag = false) with argument true loads the Factories of all Shipping methods.
Additional information
The issue can be fixed by introducing the conditional check on toOptionArray function like the below:
if ($isActiveOnlyFlag) {
$carriers = $this->_shippingConfig->getActiveCarriers();
} else {
$carriers = $this->_shippingConfig->getAllCarriers();
}
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status