I am using the Profile module 8.x-1.0-alpha5 and Conditional Fields 8.x-1.x-dev on Drupal 8.2.5. I am trying to make one field on the profile conditional on another, but when I do I get two exceptions:
Notice: Undefined offset: 0 in Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements() (line 196 of core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php).
Drupal\file\Plugin\Field\FieldWidget\FileWidget->formMultipleElements(Object, Array, Object) (Line: 84)
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements(Object, Array, Object) (Line: 104)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 168)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 54)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 115)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 514)
Notice: Undefined offset: 0 in Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements() (line 90 of core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php).
Drupal\image\Plugin\Field\FieldWidget\ImageWidget->formMultipleElements(Object, Array, Object) (Line: 104)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 168)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 54)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 115)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 514)
The dependent is a text field and the dependee is a taxonomy term list.
Comment | File | Size | Author |
---|---|---|---|
#8 | conditional_fields-fixing-Undefined-offset-0-exception-2843977-8.patch | 1.6 KB | darol100 |
Comments
Comment #2
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedThe plugin for a select widget is under developing.
If You had multiply select it was added in the last release (2017-Apr-07)
Regards.
Comment #3
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedResolved in the release 2017-Apr-26
Comment #4
DarkstarTom CreditAttribution: DarkstarTom commentedI have upgraded to the 2017-Apr-26 version and I still have this error.
Comment #5
OlgaRabodzei CreditAttribution: OlgaRabodzei at Adyax commentedComment #6
Mars0test CreditAttribution: Mars0test at Niji commentedI the problem is real when you don't create conditional field about date's field.
There isn't check if
exist.
a simple isset() to check if array exist should be good.
Anhh sorry, I have not fix the problème from the issue. Because i can't reproduce the problem.
The problem solve by my patch is the notice :
and the notice :
Comment #7
darol100 CreditAttribution: darol100 as a volunteer and commentedThe patch from #6 is not longer applicable.
Comment #8
darol100 CreditAttribution: darol100 as a volunteer and commentedHere is the update version of the patch.
Comment #9
colanCan we combine these into one line?
What's the reason for switching from a constant to a literal here? What's wrong with
DATETIME_DATE_STORAGE_FORMAT
?Comment #10
colanComment #11
colanThis issue is older, but #2908866: Undefined index value in ConditionalFieldEditForm->submitForm has a better patch, and it's already RTBC.
Comment #12
Road Kill CreditAttribution: Road Kill commentedI have opened this issue again here https://www.drupal.org/project/conditional_fields/issues/3063270#comment...