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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dpacassi created an issue. See original summary.

dpacassi’s picture

dpacassi’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: video_nested_entities-2722675-2.patch, failed testing.

The last submitted patch, 2: video_nested_entities-2722675-2.patch, failed testing.

The last submitted patch, 2: video_nested_entities-2722675-2.patch, failed testing.

heshanlk’s picture

Status: Needs work » Reviewed & tested by the community

This patch looks good. I'll add it to the dev release soon.

heshanlk’s picture

Status: Needs review » Needs work

The last submitted patch, 8: video_nested_entities-2722675-8.patch, failed testing.

The last submitted patch, 8: video_nested_entities-2722675-8.patch, failed testing.

The last submitted patch, 8: video_nested_entities-2722675-8.patch, failed testing.

  • heshanlk committed 33abb98 on 8.x-1.x authored by dpacassi
    Issue #2722675 by dpacassi, heshanlk: Notice: Undefined index: fids in...
heshanlk’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

darren.fisher’s picture

Latest 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?