-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: OrderComponent: SalesIssue: 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.Reported on 2.4.8-p2Indicates 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
Preconditions and environment
- Magento version: 2.4.8-p2
Steps to reproduce
- Create a custom script or use a module with the following code:
/** @var \Magento\Sales\Api\OrderRepositoryInterface $orderRepository */
/** @var \Magento\Sales\Model\Service\InvoiceService $invoiceService */
$orderId = 7030365; // use a valid order_id that can be invoiced
$order = $orderRepository->get($orderId);
$this->_logger->info("Before entity type: " . $order->getEntityType());
$invoice = $invoiceService->prepareInvoice($order);
$this->_logger->info("After entity type: " . $order->getEntityType());`
- Run the custom script.
Expected result
Before entity type: order
After entity type: order
Actual result
Before entity type: order
After entity type: invoice
Additional information
The $order object’s entity type changes to invoice after calling prepareInvoice().
$order should always remain of entity type "order".
Impact:
This behavior can cause unexpected side effects:
Other logic using the same $order object may incorrectly treat it as an invoice.
Leads to data integrity issues and inconsistent behavior.
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
Area: OrderComponent: SalesIssue: 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.Reported on 2.4.8-p2Indicates 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
Ready for Development