Closed
Description
Preconditions
- Magento 2.3.3
- Production mode and development mode
Steps to reproduce (*)
- Install Magento 2.3.3 with sample data
- Add grouped product to cart (Set of Sprite Yoga Straps)
- Place order
- Login in admin section
- Create invoice for order
- Create credit memo for order
- In the credit memo section click 'Send Email'
Expected result (*)
- Mail is send
- No Fatal Error
Actual result (*)
Fatal error: Uncaught TypeError:
Argument 1 passed to Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder::getItemPrice() must be an instance of Magento\Sales\Model\Order\Item,
instance of Magento\Sales\Model\Order\Creditmemo\Item given,
called in /www/magento233/vendor/magento/module-sales/view/frontend/templates/email/items/creditmemo/default.phtml
on line 32 and defined in /www/magento233/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php:99
Stack trace:
#0 /www/magento233/vendor/magento/module-sales/view/frontend/templates/email/items/creditmemo/default.phtml(32): Magento\Sales\Block\Order\Email\Items\Order\DefaultOrder->getItemPrice(Object(Magento\Sales\Model\Order\Creditmemo\Item))
#1 /www/magento233/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/ww...')
#2 /www/magento233/vendor/magento/framework/View/Element/Template.php(271): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Gro in /www/magento233/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php on line 99
When async email is enabled
report.CRITICAL: Error when running a cron job
{"exception":
"[object] (RuntimeException(code: 0): Error when running a cron job at /www/magento233/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php:330,
TypeError(code: 0):
Argument 1 passed to Magento\\Sales\\Block\\Order\\Email\\Items\\Order\\DefaultOrder::getItemPrice() must be an instance of Magento\\Sales\\Model\\Order\\Item,
instance of Magento\\Sales\\Model\\Order\\Creditmemo\\Item given,
called in /www/magento233/var/view_preprocessed/pub/static/vendor/magento/module-sales/view/frontend/templates/email/items/creditmemo/default.phtml
on line 1 at /www/magento233/vendor/magento/module-sales/Block/Order/Email/Items/Order/DefaultOrder.php:99)"} []
Bug introduced at #22265
But if you would revert this change, the mail works, but the subtotal is wrong indeed. So I think the accepted PR did some wrong fix.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done