Steps to reproduce:
1. Add a paragraph type with required text field
2. Add paragraph field to basic page and use the experimental widget
3. Create a page and add paragraph with title
4. Add another paragraph and leave title empty
5. Click collapse all or edit the first paragraph (to collapse the second paragraph without title)
6. Click save
Expected result: Field validation fails with a message "title field is required".
Actual result: Field validation fails with a message "This value should not be null".
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | experimental_widget.png | 59.2 KB | Deeksha B |
| #5 | required_field.png | 81.6 KB | Deeksha B |
| #3 | 3030966-3.patch | 1.86 KB | megha_kundar |
Comments
Comment #2
Mark Isherwood commentedNot 100% sure if this is the same issue or a problem with Media Library. I encountered this same error message with a required Media field (using Media Library widget), which was nested inside another paragraph. After selecting an image with the media library, the image would not show on the form and the error message would display. The issue occurred both with the experimental and classic paragraphs widget. Only work-around I found was making the media field as non-required
Comment #3
megha_kundar commentedAdded function for Required field in paragraph types
Comment #4
megha_kundar commentedplease review
Comment #5
Deeksha B commentedI used above steps in the issue summary, and the patch 3030966-3.patch worked fine for me below is the result.
Comment #6
miro_dietiker@Deeksha B - your screenshot shows client side validation by the browser and not a Drupal validation error message - thus unrelated.
@Megha_kundar - A test-only patch is supposed to test the bug, and thus fail until the bug is fixed. You are not asserting the bug described in the title.
Back to active as the original problem is not covered by the patches.
Comment #7
acbramley commentedGetting a similar issue with a paragraph that contains a formatted text field. If a user has added a paragraph with a text format that another user doesn't have access to then if that other user tries to save a page they get
The value you selected is not a valid choice., but only when the paragraph is collapsed. Clicking edit on that paragraph shows the "This field has been disabled because you do not have sufficient permissions to edit it." text area, then saving works.Steps to reproduce:
1) Create a paragraph with a Text (formatted) field
2) Create a text format and 2 roles, one of which can't use that text format
3) Sign in as a user with the role that can access the text format (user a) and create a page with a paragraph on it with the new text format
4) Sign in as another user with the role that can't access the text format (user b) and edit the page
5) Collapse the paragraph and click save
Expected:
Page is saved
Actual:
Error message shown "The value you selected is not a valid choice."
6) Click edit on the paragraph and hit save
This works.
This same behaviour doesn't happen with the classic widget, nor with a plain core field.
Comment #8
berdirThat has been fixed in 8.x-1.x-dev.
Comment #9
acbramley commented@Berdir awesome news, thanks!
Comment #10
handkerchiefGetting similar issue with referenced media entities. In my case paragraph is the problem.
I described the error in this issue: #3058037: Media Library can't attach media to media reference field in nodes due to AJAX problem when using table view
Core: 8.7.5
Paragraph: 8.x-1.x-dev
Error messages:
Widget Paragraph Classic:
@see https://www.drupal.org/project/drupal/issues/3058037#comment-13199839
Widget Paragraph Experimental:
An error occurs already if I click on "Add media":
Comment #11
handkerchiefMy case is "solved": https://www.drupal.org/project/drupal/issues/3003150#comment-13200228
Comment #12
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 #13
monymirzaComment #14
monymirza