sveawebpay / nwt-magento2-checkout

Svea Checkout plugin for Magento 2
Apache License 2.0
0 stars 12 forks source link

Can't view none SVEA orders in admin #61

Closed andrewsurrey closed 1 year ago

andrewsurrey commented 1 year ago

There's an issue whereby you can't view old orders in the admin, this was for version 1.3.13

This version seems to have been removed from the repository now, which can cause issues for people who have already installed it.

There's a simple patch to fix that:

diff --git a/ViewModel/Adminhtml/Order/View/Shipping.php b/ViewModel/Adminhtml/Order/View/Shipping.php
--- a/ViewModel/Adminhtml/Order/View/Shipping.php
+++ b/ViewModel/Adminhtml/Order/View/Shipping.php
@@ -39,7 +39,7 @@
     {
         if (!$this->locationObj) {
             $shipInfo = $this->sveaShippingInfo->getFromOrder($order);
-            $locationData = $shipInfo->getLocation();
+            $locationData = $shipInfo?->getLocation() ?? [];
             $this->locationObj = $this->dataObjectFactory->create()->setData($locationData);
         }
        return $this->locationObj;
martinSternelius commented 1 year ago

This will be fixed in the next release. Apologies for the inconvenience.

martinSternelius commented 1 year ago

Should be fixed now in the release we just published.