Problem/Motivation
In RHDC, a migration from D7 to D9 may have introduced data into some patterns that don't match the schema. This seems to cause patternkit to omit validation checks when a required field in a schema isn't filled out.
This test is to validate that required fields within a schema are properly validated in patternkit.
Steps to reproduce
Pre-requisite
- Add "required": ["text"] in the schema file to make that particular field mandatory/required.
- Enable Patternkit and Patternkit example module.
- Configure a node type and enable layout builder.
- Add a new content with layout builder enabled and fill out the required field.
- Go to layout builder tab.
- Add [Patternkit] Example block
- Don't give any input in the text field which is required
- Click on add/save block
Success Criteria
- On save, any required fields on a pattern are filled out
- If any data in the pattern doesn't match the schema
- Fail validation and provide opportunity for the editor to fix
- Display validation failure information to guide the editor
- Don't allow submission of the form
API changes
N/A
Data model changes
N/A
Issue fork patternkit-3453875
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
minsharm commentedComment #3
minsharm commentedComment #7
sluceroI've added a new merge request branch, 3453875--submission-validation, that aims to fix and enable submission validation from JSON Editor forms when creating or editing a pattern block. When an invalid value is provided, client-side validation should show a warning for the related field, and if any validation would fail when the form is submitted, the form should be re-displayed to the user with a validation failure message and appropriate feedback.
Comment #8
sluceroComment #9
minsharm commentedI have tested this issue on both D10 and D11 and result looks good to me.
Comment #12
sluceroComment #14
sluceroMerged for inclusion in the 9.1.3 release. See #3542304: Patternkit 9.1.3 Release Plan.