Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,17 @@ protected function prepareTemplate(Order $order)
'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
];
$transport = new DataObject($transport);
$transportObject = new DataObject($transport);

/**
* Event argument `transport` is @deprecated. Use `transportObject` instead.
*/
$this->eventManager->dispatch(
'email_order_set_template_vars_before',
['sender' => $this, 'transport' => $transport]
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @gwharton, due to Magento backward-compatible guide we can't rename or remove event arguments or change their type.

Adding the new arguments is allowed. If it doesn't help, you can introduce new event argument with new name or type and deprecate the old argument by adding @deprecated annotation before dispatching the event

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what has been done. $transport = $transportObject->getData() therefore the original arguments have not changed type or name. We introduce a new argument $transportObject

);

$this->templateContainer->setTemplateVars($transport->getData());
$this->templateContainer->setTemplateVars($transportObject->getData());

parent::prepareTemplate($order);
}
Expand Down