Our site uses Paragraphs and Conditional Fields. When saving a conditional field condition where the control field is a paragraph field, I receive the following error:
The website encountered an unexpected error. Please try again later.
TypeError: Drupal\Core\Field\WidgetBase::setWidgetState(): Argument #4 ($field_state) must be of type array, null given, called in /var/www/html/modules/contrib/paragraphs/src/Plugin/Field/FieldWidget/ParagraphsWidget.php on line 2252 in Drupal\Core\Field\WidgetBase::setWidgetState() (line 497 of core/lib/Drupal/Core/Field/WidgetBase.php).
Drupal\paragraphs\Plugin\Field\FieldWidget\ParagraphsWidget->multipleElementValidate(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 282)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'conditional_field_edit_form') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('conditional_field_edit_form', Array, Object) (Line: 591)
Drupal\Core\Form\FormBuilder->processForm('conditional_field_edit_form', Array, Object) (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
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: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I don't know if this counts as a bug, or a support request, so I've categorized it as a bug for now. However, I was able to identify where the issue occurs in the code and create a patch that fixes the error and maintains the ability to save changes as expected.
I'll attach the patch I made to this issue.
Active
1.15
Code