【问题标题】:Magento - unable to view order after upgrade to 2.4.3Magento - 升级到 2.4.3 后无法查看订单
【发布时间】:2022-01-11 17:40:59
【问题描述】:

我最近将 Magento(开源)商店从 2.4.2 升级到 2.4.3。客户使用 PayPal Express Checkout 作为付款方式下订单。

当我尝试在管理屏幕中查看他们的订单时,我收到错误订单加载期间发生异常

如果我随后检查 exception.log,我会收到以下消息:

main.CRITICAL: Type Error occurred when creating object: Magento\InventorySourceSelection\Model\Address, Argument 1 passed to Magento\InventorySourceSelection\Model\Address::__construct() must be of the type string, null given, called in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121 {"exception":"[object] (Magento\\Framework\\Exception\\RuntimeException(code: 0): Type Error occurred when creating object: Magento\\InventorySourceSelection\\Model\\Address, Argument 1 passed to Magento\\InventorySourceSelection\\Model\\Address::__construct() must be of the type string, null given, called in vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 121 at vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:131)"} []

我认为这是由 2.4.3 升级引起的,因为在此之前的其他订单都可以。大多数升级后的订单 也很好,所以这个订单有些奇怪。我已经检查过:

  • 订购的产品有货
  • 帐单和送货地址是完整的(他们缺少县/州,但我的商店不需要)

这似乎是同一个问题noted here on GitHub

我还尝试在我的测试盒上升级到 2.4.3-p1,看看是否有帮助,但无济于事。我已经尝试过 DI 编译、缓存清除、重新索引等常规技巧。

以前有没有人经历过这种情况并有任何调试技巧?我目前无法处理订单。

【问题讨论】:

    标签: magento2


    【解决方案1】:

    从报错信息来看,我猜出现这个问题是因为这个订单中客户的地址错误或者数据缺失。

    请仔细检查地址并确保您拥有所有信息,尤其是邮政编码。

    如果数据丢失,您只需要更新地址即可。

    【讨论】:

    • 感谢您的回复。我看不到订单上或客户帐户中的地址有任何问题,但我会继续挖掘它是否存在于我尚未检查的 sales_order_* 表中
    【解决方案2】:

    原来这是 Amasty Shipping Table Rates 模块中的一个错误(通过 https://github.com/magento/inventory/issues/2362 找到)。

    解决办法是改变:

    return $this->inventorySourceSelectionAddressFactory->create([
                'country'   => $shippingAddress->getCountryId(),
                'postcode'  => $shippingAddress->getPostcode() ?? '',
                'street'    => implode("\n", $shippingAddress->getStreet()),
                'region'    => $shippingAddress->getRegionCode() ?? '',
                'city'      => $shippingAddress->getCity() ?? ''
            ]);
    

    到....

    return $this->inventorySourceSelectionAddressFactory->create([
                'country'   => $shippingAddress->getCountryId() ?? '',
                'postcode'  => $shippingAddress->getPostcode() ?? '',
                'street'    => implode("\n", $shippingAddress->getStreet()),
                'region'    => $shippingAddress->getRegionCode() ?? '',
                'city'      => $shippingAddress->getCity() ?? ''
            ]);
    

    (更改在 getCountryId())

    【讨论】:

      猜你喜欢
      • 2011-02-23
      • 2023-03-13
      • 1970-01-01
      • 2021-10-24
      • 2012-10-26
      • 2018-11-30
      • 1970-01-01
      • 2012-12-11
      • 1970-01-01
      相关资源
      最近更新 更多