After upgrade to Drupal core 8.0.1 I got long notice when I tried to edit node with field collection color field:
Notice: Undefined index: #required in Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetDefault->formElement() (line 94 of modules/color_field/src/Plugin/Field/FieldWidget/ColorFieldWidgetDefault.php).
Drupal\color_field\Plugin\Field\FieldWidget\ColorFieldWidgetDefault->formElement(Object, 0, Array, Array, Object)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object)
Drupal\Core\Field\WidgetBase->formMultipleElements(Object, Array, Object)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object)
Drupal\field_collection\Plugin\Field\FieldWidget\FieldCollectionEmbedWidget->formElement(Object, 0, Array, Array, Object)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object)
Drupal\Core\Field\WidgetBase->formMultipleElements(Object, Array, Object)
Drupal\field_collection\Plugin\Field\FieldWidget\FieldCollectionEmbedWidget->formMultipleElements(Object, Array, Object)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object)
Drupal\node\NodeForm->form(Array, Object)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array)
Drupal\Core\Form\FormBuilder->retrieveForm('node_solution_category_edit_form', Object)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
Comment | File | Size | Author |
---|---|---|---|
#2 | fixed-notice-2642712-2.patch | 589 bytes | Ivan Zugec |
|
Comments
Comment #2
Ivan Zugec CreditAttribution: Ivan Zugec at WebWash commentedFixed the notice warning.
The $element variable is being passed into the formElement method preloaded with values. However, it's being re-declared as an empty array, i.e., "$element = [];". The attached patch removes "$element = [];" from "formElement"
Comment #5
kasperg CreditAttribution: kasperg at Reload commented#2 works and looks like the right solution to me.
There are no tests for this module. I guess that is causing testbot to fail.
Comment #6
jackbravo CreditAttribution: jackbravo commentedYes, works for me too.
Comment #7
dabbor CreditAttribution: dabbor at Morpht commentedJust letting you know, it works for me too.
Thanks Ivan ;)
Comment #8
Christophe Bourgois CreditAttribution: Christophe Bourgois as a volunteer commented#2 worked for me also
Comment #10
targoo CreditAttribution: targoo at MariqueCalcus commentedMerge to dev. Thanks for the patch.
Comment #11
targoo CreditAttribution: targoo at MariqueCalcus commented