-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Area: FrameworkIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.5-p1Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Description
Summary
Magento 2.4.5-p1
Loading order through repository loads the order three times from DB :
$this->orderRepository->get($orderId);
Loads the order from database, then calls setShippingAssignments() which calls TaxManagement::getShippingAssignmentBuilderDependency() which loads the order from database again.
and
Examples
$this->orderRepository->get($orderId);
Steps to reproduce
- Login in frontend with the user which has atleast 1 order
- Enable DB log
- Add breakpoints in the below lines:
$entity = $this->metadata->getNewInstance()->load($id);
$order = $this->orderFactory->create()->load($this->getOrderId()); |
$this->order = $this->orderFactory->create()->load($this->getOrderId()); |
4. Try to access
My Account
page5. The function
$this->orderFactory->create()->load($this->getOrderId())
is calling 3 times for order id 2
. Below is the MySQL query fetched from db.log:
SELECT `sales_order`.* FROM `sales_order` WHERE (`sales_order`.`entity_id`='2')
SELECT `sales_order`.* FROM `sales_order` WHERE (`sales_order`.`entity_id`='2')
SELECT `sales_order`.* FROM `sales_order` WHERE (`sales_order`.`entity_id`='2')
Proposed solution
I guess line
$shippingAssignments->setOrderId($order->getEntityId());
should be replaced somehow by
$shippingAssignments->setOrder($order);
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
Labels
Area: FrameworkIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.5-p1Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itIssue related to Developer Experience and needs help with Triage to Confirm or Reject it
Type
Projects
Status
Done