We are using the experimental mode for contribution and detected a major issue.
Let's say we have a paragraph with an entity_reference field.
I can create a new node with this paragraph and save without any issue.
But I cannot create a new node with 2+ paragraphs and save.
When I do this, I have the error message : This value should not be null.
Of course, this problem does not happen when we use classic mode.
@see the experimental mode configuration we are using.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | experimental-mode-issue.png | 93.14 KB | Pauline G |
Comments
Comment #2
Pauline G commentedComment #3
Pauline G commentedComment #4
Pauline G commentedParagraphs Features module seems to solve this issue.Comment #5
miro_dietikerThe tests contain many cases where a node has multiple Paragraphs and sure we are using the module that way.
Please provide more information so we can reproduce what causes this problem.
Best is if you try to reproduce in a new installation with adding your modules and testing specific configuration step by step...
Comment #6
web-beestI also have had this error, but the root cause lies somewhere else. In my case, when I disabled the experimental mode and changed to classic the error still persisted. When digging a little deeper, I found that is was triggered by a required field which was hidden in the form display (don't ask my why it was required but hidden). This triggered this generic error. After altering the form display, it worked as designed.
Comment #7
Pauline G commentedAfter further investigations, I'm now able to explain how to reproduce this problem.
The issue is linked to media library and happens whether we use classic or experimental mode.
Starting with Drupal 8.6 and Paragraphs 8x.1-5.
Let's say we want to create a node, containing a field "components" as a paragraph reference.
We add 2 "image" items, each one containing a required media field.
Note that the issue is not reproductible with a non-required field.
When we hit save, we have the error `This value should not be null`.
Not sure this is linked to paragraphs module though.
There is a core issue here: https://www.drupal.org/project/drupal/issues/3003150
Comment #8
bdanin commentedI too confirm this same Error message "This value should not be null." happening with a paragraph entity reference field using Media Library. Note, this is a paragraph inside another paragraph on a node page.
Comment #9
superbiche commentedI confirm the same behavior, using a node.field_components referencing many possible types of paragraphs. Current situation :
https://d.pr/i/z2QlPe
the paragraphs used don't include embedded paragraphs, but Media entity references.
When I save the page without making a change : https://d.pr/i/uXVben
When I un-fold everything by clicking the "Edit all" link, and without any further change, I can save the page without a problem.
Comment #10
capellicThanks @Pauline G for that write-up, that's exactly what we're dealing with over here.
Comment #11
berdirCan you try to most recent dev version? I think we made some improvements in how we report those errors and we started ignoring some cases.
Comment #12
mindaugasd commentedInstalling latest dev version did not help.
My issue is same as @pauline-g described #7.
Solved it temporary by marking that field as not required.
Later I may try Core's patch https://www.drupal.org/project/drupal/issues/3003150#comment-12894737 if its the same issue.
Comment #13
harlor commentedIt seems I'm currently facing the same issue with the latest dev-version.
https://www.drupal.org/project/drupal/issues/3003150#comment-12894737 didn't work for me either.
I will use a non-required field as a workaround.
Comment #14
seanbThis issue is probably fixed by #3003150-78: Media library causes validation errors when it is used in a required field of a nested form. Feedback is very welcome :)
Comment #15
martijn de witLatest patch form #3013035: This value should not be null solved the issue using the media library in combination with paragraphs module where a media field inside a paragraph was required. (thank you @seanB for the reference)
Before this patch, the field gave the error: "This value should not be null."
Very annoying because there was no trace of it in any log that I could see...
Comment #16
ankit agrawal commentedI have recently faced this issue with the media library widget used in the media field of the paragraph, got resolved after changing the widget to entity browser.
Comment #17
mykola dolynskyiSolved, TL/DR
I was able to trace the field name by injecting into web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php::validate() and printing the $this->getViolations()[0]
so it has nothing with contrib code, reason was in custom logic.
-------------
Still facing it.
Node is saved. Attempt to save second time.
paragraphs field is empty.
Widget is empty (paragraphs (stable)).
No Media Browser used, Entity Browser instead.
Drupal 9.5.latest