I'm currently using the video module 8.x-1.2 on a D8.1.1 site of mine.
I've build my site with paragraphs, meaning that my content is attached to the paragraph entities and the paragraph entities to nodes.
I've added a video field to one of my paragraph entities and while everything works great, I receive following error message after adding a video to the video field:
Notice: Undefined index: fids in Drupal\file\Plugin\Field\FieldWidget\FileWidget->massageFormValues() (line 283 of core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php).
Drupal\file\Plugin\Field\FieldWidget\FileWidget->massageFormValues(Array, Array, Object) (Line: 420)
Drupal\video\Plugin\Field\FieldWidget\VideoEmbedWidget->extractFormValues(Object, Array, Object) (Line: 222)
Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues(Object, Array, Object) (Line: 1072)
Drupal\paragraphs\Plugin\Field\FieldWidget\InlineParagraphsWidget->elementValidate(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 277)
I did some digging and found out that the error is being caused by the array giving to massageFormValues()
contains values that didn't define the fids
array key.
I'll attach a patch where I delete such elements from the array.
The error message disappears then but this is probably only a workaround and not a real bugfix.
For a bugfix, we probably would need to check what the $values = NestedArray::getValue($form_state->getValues(), $path, $key_exists);
part needs to do and why it is returning values which have no video field attached at all.
Comment | File | Size | Author |
---|---|---|---|
#8 | video_nested_entities-2722675-8.patch | 690 bytes | heshanlk |
#2 | video_nested_entities-2722675-2.patch | 2.62 KB | dpacassi |
Comments
Comment #2
dpacassiSee attached my workaround/patch for this issue.
Comment #3
dpacassiComment #7
heshanlkThis patch looks good. I'll add it to the dev release soon.
Comment #8
heshanlkComment #13
heshanlkComment #15
darren.fisher CreditAttribution: darren.fisher at Pivale commentedLatest dev branch got rid of this issue for me. Thanks for all the hard work. Any idea when all of these changes will be rolled out to the next stable release of the module?