The following occurs when trying to migrate product variations:

PHP Fatal error: Call to a member function shouldGenerateTitle() on a non-object in .../modules/contrib/commerce/modules/product/src/Entity/ProductVariation.php on line 424

I'm not sure where this should be posted since there is no D8 Commerce Migrate project. I'm just hoping that someone who understands the product code better might know why this is happening. It didn't happen with Alpha2. I'm using the code at https://github.com/creativepragmatic/commerce_migrate.

Comments

creativepragmatic created an issue. See original summary.

bojanz’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

danbruder’s picture

Version: 8.x-2.0-alpha3 » 8.x-2.0-alpha4
Assigned: Unassigned » danbruder
StatusFileSize
new639 bytes

I am also migrating commerce content and am getting the same error but from a different place: line 269 in the preSave method.

I applied the same fix from this issue to line 269 and the migration ran successfully. Patch is attached

danbruder’s picture

Status: Closed (fixed) » Needs review

I forgot to set the status to needs review in my previous comment ^

bojanz’s picture

Status: Needs review » Closed (fixed)

Looks like that one was fixed in #2752435: Fatal error: Call to a member function shouldGenerateTitle() on a non-object .

We'll probably want to add different code to ensure that the specified bundle actually exists. Looks like Drupal doesn't guard well against this.