Got another issue. On my existing product (one that has multiple variants already attached) I'm not seeing the button from this module. And when I go to add a new product, blank slate, I get the following error...

The website encountered an unexpected error. Please try again later.
Error: Call to a member function bundle() on boolean in Drupal\commerce_bulk\Plugin\Field\FieldWidget\BulkSkuWidget->formElement() (line 184 of modules/contrib/commerce_bulk/src/Plugin/Field/FieldWidget/BulkSkuWidget.php).
Drupal\commerce_bulk\Plugin\Field\FieldWidget\BulkSkuWidget->formElement(Object, 0, Array, Array, Object) (Line: 335)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 202)
Drupal\Core\Field\WidgetBase->formMultipleElements(Object, Array, Object) (Line: 104)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 171)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 170)
Drupal\inline_entity_form\Form\EntityInlineForm->entityForm(Array, Object) (Line: 136)
Drupal\inline_entity_form\Element\InlineEntityForm::processEntityForm(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 997)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_clothing_add_form', Array, Object) (Line: 1060)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_clothing_add_form', Array, Object) (Line: 1060)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_clothing_add_form', Array, Object) (Line: 1060)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_clothing_add_form', Array, Object) (Line: 1060)
Drupal\Core\Form\FormBuilder->doBuildForm('commerce_product_clothing_add_form', Array, Object) (Line: 561)
Drupal\Core\Form\FormBuilder->processForm('commerce_product_clothing_add_form', Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder->buildForm('commerce_product_clothing_add_form', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 669)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

xpersonas created an issue. See original summary.

drugan’s picture

Note that all variation bulk functionality is now moved to the Variations tab. So, there should not be Add NNN variations button on a /product/NNN/edit form. Furthermore, it is recommended to disable Variations field on this form:

/admin/commerce/config/product-types/YOUR_PRODUCT_TYPE/edit/form-display

As the new version of the commerce_bulk requires core's Actions module and system actions and a view to be installed so, the best way to apply all new features is to reinstall the module. Then just go to the /product/NNN/variations tab and manually add at least one variation. After that select a variation you want to duplicate price and list price and, for example custom variation image field, and execute action Duplicate variation -> Apply to selected items action. All the bulk variation actions are self-explanatory as it seems for me. Please, do not hesitate to ask a question if something is not clear for you.

  • drugan committed a0e6554 on 8.x-1.x
    Issue #3021606: Call to a member function bundle() on boolean
    
drugan’s picture

Added condition check to exclude error if someone enables Variations field on a product edit form. Will be moved to the next stable release.

xpersonas’s picture

Status: Active » Fixed

That cleared the error. Thanks!

Status: Fixed » Closed (fixed)

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