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.

CommentFileSizeAuthor
#3 experimental-mode-issue.png93.14 KBPauline G

Comments

Pauline G created an issue. See original summary.

Pauline G’s picture

Issue summary: View changes
Pauline G’s picture

Issue summary: View changes
StatusFileSize
new93.14 KB
Pauline G’s picture

Paragraphs Features module seems to solve this issue.

miro_dietiker’s picture

Status: Active » Postponed (maintainer needs more info)

The 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...

web-beest’s picture

I 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.

Pauline G’s picture

After 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

bdanin’s picture

I 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.

superbiche’s picture

I 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.

capellic’s picture

Thanks @Pauline G for that write-up, that's exactly what we're dealing with over here.

berdir’s picture

Version: 8.x-1.5 » 8.x-1.x-dev

Can 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.

mindaugasd’s picture

Title: This value should not be null with experimental mode » This value should not be null

Installing 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.

harlor’s picture

It 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.

seanb’s picture

martijn de wit’s picture

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

ankit agrawal’s picture

I 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.

mykola dolynskyi’s picture

Solved, 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