-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.2-develop] Transport variable can not be altered in email_invoice_set_template_vars_before Event #15040
[2.2-develop] Transport variable can not be altered in email_invoice_set_template_vars_before Event #15040
Conversation
…g Variables" This reverts commit 8ef039e.
Add missing commits for \app\code\Magento\Sales\Model\Order\Email\Sender\OrderSender.php
Hi, @gwharton , I took your PR into processing, thank you for collaboration. |
$this->eventManager->dispatch( | ||
'email_order_set_template_vars_before', | ||
['sender' => $this, 'transport' => $transport] | ||
['sender' => $this, 'transport' => $transportObject->getData(), 'transportObject' => $transportObject] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look at the original commit in #10210, the event arguments were changed for all email_***_set_template_vars_before events already. This PR, and the other two, are correcting the fact that the original author missed one of the 7 events that needed updating.
If this PR and the other 2 don't go through, it will leave us with 6 of the events with different types to this one.
We add a new object 'transportObject' to the event, but maintain the original 'transport' object for backwards compatability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gwharton As I see, in 10210, that fixes were delivered to Magento 2.1 and 2.2 branches but weren't delivered to 2.3
We add a new object 'transportObject' to the event, but maintain the original 'transport' object for backwards compatability.
- But as I see the
transfer
object interface was changed or I was mistaken?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the code to generate $transport has changed, but the contents and type of $transport have not changed.
$transport = $transportObject->getData() therefore the original arguments have not changed type or name. |
Ok, sorry, I took to progress this PR. Thanks. |
Brilliant thanks. In the original PR for #10210 there are pull requests for 2.1 2.2 and 2.3, however each of the original pull requests were missing the fix for the file /app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php These new three PR's augment the original PR's from #10210 to make the fix complete across all three branches. I hope this makes sense. |
…mail_invoice_set_template_vars_before Event #15040
Hi @gwharton. Thank you for your contribution. Please, consider porting this solution across release lines. |
…revious changes. #16594
Accepted Public Pull Requests: - #17217: [Backport] Broken Responsive Layout on Top page (by @mage2pratik) - #17203: [Backport] Refactored multiples conditions which could be grouped in a single on� (by @mage2pratik) - #17246: [Backport] FIXED: FTP user and password strings urldecoded (by @mage2pratik) - #17236: [Backport] Fixed invalid knockoutjs data binding for Braintree PayPal (by @tiagosampaio) - #16594: Fix broken commit in #15040 that accidentally reverted previous changes. (by @gwharton) - #17122: Added missing exception cause for better error handling (by @woutersamaey) - #17153: Set proper text-aligh for the <th> element of the Subtotal column in the Creditmemo email (by @TomashKhamlai) - #17127: Allow 3rd party modules to perform actions after totals calculation (by @navarr) - #16505: admin checkout agreement controllers refactor (by @AnshuMishra17) - #16000: Don't force enable "Use system value" checkboxes (by @likemusic) Fixed GitHub Issues: - #15009: [2.2.4] Gallery theme variables being ignored (reported by @gwharton) has been fixed in #16594 by @gwharton in 2.2-develop branch Related commits: 1. a012c45 - #16580: Product gallery caption issue (reported by @Karlasa) has been fixed in #16594 by @gwharton in 2.2-develop branch Related commits: 1. a012c45
Fix missing commits from #10210 Transport variable can not be altered in email_invoice_set_template_vars_before Event
Description
Original commit in #10210 missed updates to the /app/code/Magento/Sales/Model/Order/Email/Sender/OrderSender.php file
Fixed Issues (if relevant)
Contribution checklist