Problem/Motivation
First, it isn't clear to me if this is something that should be logged against Core or the Paragraphs module. It's hard to know if it's core behavior that creates unexpected results in certain situations (like nested forms) or if it's an issue with how Paragraphs are submitted/validated. I can't find a similar issue in either place.
Steps to Reproduce
- Install Drupal 8.6.x with the core Media and Media Library modules enabled; also install/enable the contrib Paragraphs module.
- Create a Paragraph type with a Media reference field that references the Image media type. Make that field required and ensure it uses the "Media library" widget.
- Add a Paragraphs field on one of the content types core adds by default. Enable the paragraph type to be used by that field.
- Navigate to the add form for that content type and add a paragraph of that type. Attempt to use the Media library widget to upload/add a photo.
Expected result: The image gets successfully added, as it would if this field was not in a paragraph or, strangely, if the paragraph's image field is not required.
Actual result: Upon submitting the modal form, a validation error is thrown: "This value should not be null." (See attached screenshot taken using simplytest.me.) The image is never successfully added in the form and as a result, can't be saved. (As previously mentioned, this does not happen when the field isn't required. The image gets added as expected.)
Proposed resolution
Determine if this is an issue with Media Library, Paragraphs, or something else and get it in the appropriate place. Then hopefully get to the bottom of it and create a patch. If someone can at least point me in the right direction of where I might debug this, I could attempt to do so myself.
Thanks for any and all help and for your work on the Media system!
Remaining tasks
TBD.