- last update
about 1 year ago Composer error. Unable to continue. - last update
about 1 year ago 13 pass Might need to look into how programmatic creation of children should be handled. With this patch applied, the children can attempt to be created.
Seeing this error in migrations, due to $parent_variation not being set:
TypeError: Drupal\commerce_vado\EventSubscriber\VadoEventSubscriber::createChildren(): Argument #1 ($parent_variation) must be of type Drupal\commerce_product\Entity\ProductVariationInterface, null given, called in /var/www/html/web/modules/contrib/commerce_vado/src/EventSubscriber/VadoEventSubscriber.php on line 310 in /var/www/html/web/modules/contrib/commerce_vado/src/EventSubscriber/VadoEventSubscriber.php on line 103 #0 /var/www/html/web/modules/contrib/commerce_vado/src/EventSubscriber/VadoEventSubscriber.php(310):
I think something like this might be better:
if ($order->get('cart')->getValue()[0]['value'] == FALSE) { $parent_variation = $order_item->getPurchasedEntity(); // Create children for non-cart orders only. if (!$parent_variation) { return; } $children = $this->createChildren($parent_variation, $order_item, $order); return $children; }