MultiSafepay / magento2-core

Provides core functionalities
Open Software License 3.0
2 stars 10 forks source link

Placing an order comment fails on Magento 2.4.3 #9

Closed Tjitse-E closed 2 years ago

Tjitse-E commented 2 years ago

Prerequisites

Steps to reproduce

  1. Place an order via banktransfer (native magento)
  2. Go to the Magento2 admin
  3. Open the order
  4. Try to place a new order comment

Expected result

A new order comment is placed and the order comment is visible.

Actual result

A request POST is done to /sales/order/addComment/order_id/1234, which triggers \MultiSafepay\ConnectCore\Observer\SetTemplateVarsBefore::execute. This results in an error:

==> /home/ivol/shared/var/log/system.log <==
[2021-12-21 08:57:34] .CRITICAL: Error: Call to a member function getOrder() on array in vendor/multisafepay/magento2-core/Observer/SetTemplateVarsBefore.php:58
Stack trace:
#0 vendor/magento/framework/Event/Invoker/InvokerDefault.php(88): MultiSafepay\ConnectCore\Observer\SetTemplateVarsBefore->execute(Object(Magento\Framework\Event\Observer))
vinodsowdagar commented 2 years ago

Hi @Tjitse-E ,

Thank you for the report. I have created a backlog item to investigate this issue.

I will get back to you as soon as possible.

vinodsowdagar commented 2 years ago

Hi @Tjitse-E ,

We have reviewed and modified your change a bit, so it has backwards compatibility with older versions as well. I will close this PR now since we already merged and released it internally: https://github.com/MultiSafepay/magento2/releases/tag/2.16.0

Thank you for the contribution!