Hi,
I have a paragraph with a media field which is required. When I select the image media in the Browse media popup and save it I get "This value should not be null.".
1. Create a paragraph
2. Add a Media field which allows for Images
3. Set the field above as 'required'
4. Attach the paragraph to a content type
5. Create content
6. Click on Browse media
7. Select an image
8. Click on save
Result: This value should not be null.
Expected result: the image should be referenced
Note: If the field is not required the field works properly.
Comments
Comment #2
miro_dietikerIs this maybe a duplicate of the related issue?
Comment #3
carolpettirossi commentedNot really. I think it's duplicated of this core issue: https://www.drupal.org/project/drupal/issues/3003150
As mentioned there, a solution is to use the Experimental widget instead of Classic.
Comment #4
daveianoPatch https://www.drupal.org/project/drupal/issues/3003150#comment-13276326 from the suggested issue in #3 works and solves the problem for me.
Comment #5
berdirGood, I would have expected #3013171: LogicException Form errors cannot be set after form validation has finished which is in in 1.9 to fix this as well but if it didn't then I don't think we can fix it in paragraphs.