After update I get Error: Call to undefined method Drupal\commerce_product\Entity\ProductType::getVariationType()

Created on 27 October 2025, 7 days ago

Problem/Motivation

When using drupal/commerce_printful:3.0.x-dev with drupal/commerce:^3.0 on Drupal 10/11,
a fatal error occurs when saving a Printful Store configuration or when importing configuration via drush cim.

Fatal error: Uncaught Error: Call to undefined method
Drupal\commerce_product\Entity\ProductType::getVariationType()
in Drupal\commerce_printful\Entity\PrintfulStore->save()
(modules/contrib/commerce_printful/src/Entity/PrintfulStore.php:144)

In Commerce 3.x, ProductType::getVariationType() was removed and replaced by getVariationTypeId().

Steps to reproduce

  1. Install drupal/commerce_printful:3.0.x-dev on a site running drupal/commerce:^3.0.
  2. Go to /admin/commerce/config/printful/stores and attempt to create/save a Printful Store entity.

    Alternatively: import configuration with drush cim that includes a Printful Store.
  3. Observe the fatal error shown above.

Actual result

Fatal error due to call to removed method ProductType::getVariationType().

Expected result

Printful Store entities save successfully and configuration imports cleanly on Commerce 3.x.

Proposed resolution

Replace the call to the removed getVariationType() with the Commerce 3.x API method
getVariationTypeId().

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom c_archer Cumbria

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.

No activities found.

Production build 0.71.5 2024