- Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Issue: ready for confirmationPriority: 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: doneTriage: 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 itstale issue
Description
Summary
When placing an observer on sales_order_state_change_before
, it's not possible to get any data from the actual order object.
Examples
see \Magento\Sales\Model\Service\OrderService->setState()
:
Current code is:
$this->eventManager->dispatch( 'sales_order_state_change_before', ['order' => $this, 'transport' => $transport] );
Because $this
is passed to the observer, and not $order
, there's no way to get order data in the observer.
Proposed solution
Change event dispatch either to 'order' => $order
, or add 'order_object'
to have it backwards compatible.
$this->eventManager->dispatch( 'sales_order_state_change_before', ['order' => $this, 'transport' => $transport, 'order_object' => $order] );
magulin and asim-vax
Metadata
Metadata
Assignees
Labels
Issue: ready for confirmationPriority: 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: doneTriage: 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 itstale issue
Type
Projects
Status
Done