Error: Call to a member function getRefreshFrequency() on null in Drupal\commerce_order\OrderRefresh->needsRefresh()

Created on 29 April 2022, over 2 years ago
Updated 9 August 2024, about 1 month ago

I had D8 site that i migrated to D9.
I did product catalog import that went fine.
After updatedb and cache clear getting the below error.

The site is using the regular commerce modules (stock, shipping and others).

Error: Call to a member function getRefreshFrequency() on null in Drupal\commerce_order\OrderRefresh->needsRefresh() (line 124 of modules/contrib/commerce/modules/order/src/OrderRefresh.php).

And this:

Error: Call to a member function getWorkflowId() on null in Drupal\commerce_order\Entity\Order::getWorkflowId() (line 928 of modules/contrib/commerce/modules/order/src/Entity/Order.php).

On first error, when i open file, i can see the below code (error is pointing to the if line and seems the order_type is null)

        $order_type = $this->orderTypeStorage->load($order->bundle());
        $refreshed_ago = $current_time - $order_time;
      if ($refreshed_ago >= $order_type->getRefreshFrequency()) {
      return TRUE;
    }
💬 Support request
Status

Fixed

Version

2.29

Component

Order

Created by

🇺🇸United States salah1 VA, U.S

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇹Italy openmode

    On /admin/commerce/orders/add..

    Error: Class "CommerceGuys\Intl\Formatter\NumberFormatter" not found in include() (line 14 of modules/commerce/modules/price/src/NumberFormatter.php).

  • 🇮🇱Israel jsacksick

    @openmode: Looks like you have a broken Commerce installation (did you install Commerce without Composer?) You need to install Commerce dependencies properly.
    The commerceguys/intl library is required by Commece, Commerce cannot work properly without it.

  • 🇮🇹Italy openmode

    libraries installed without Composer in /libraries/commerceguys/intl with Ludwig

Production build 0.71.5 2024