Issue when creating new product

Created on 29 May 2024, 7 months ago

Describe your bug or feature request.

When I tried to add new product with variations, its giving an issue.

TypeError: reset(): Argument #1 ($array) must be of type array, null given in reset() (line 134 of commerce/modules/product/src/Plugin/Field/FieldWidget/SingleVariationWidget.php).
Drupal\commerce_product\Plugin\Field\FieldWidget\SingleVariationWidget->formElement() (Line: 459)
Drupal\Core\Field\WidgetBase->formSingleElement() (Line: 101)
Drupal\Core\Field\WidgetBase->form() (Line: 124)
Drupal\commerce_product\Plugin\Field\FieldWidget\SingleVariationWidget->form() (Line: 186)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm() (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form() (Line: 82)
Drupal\commerce_product\Form\ProductForm->form() (Line: 107)
Drupal\Core\Entity\EntityForm->buildForm() (Line: 73)
Drupal\commerce_product\Form\ProductForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 48)
Drupal\redirect_after_login\RedirectMiddleware->handle() (Line: 54)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 43)
Drupal\webform_product\RedirectMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

If a bug, provide steps to reproduce it from a clean install.

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.38

Component

Product

Created by

🇳🇵Nepal lalustine

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

Comments & Activities

  • Issue created by @lalustine
  • Status changed to Closed: cannot reproduce 7 months ago
  • 🇮🇱Israel jsacksick

    These are errors that can't be reproduced on a clean install... Something probably went wrong while upgrading to D10 or something (referring to the other issues reported already)...

    Can you try resaving your product type perhaps? This error would seem to indicate the variation types setting isn't properly configured... Could be that it was set in an update hook, and then the change got reverted when importing config or something?

Production build 0.71.5 2024