Problem/Motivation
When we restore Node , we are getting error stating: This value can not be null.
Steps to reproduce
After Debugging came to know :
1. Delete the node which has field in disabled mode (from manage display) and has required true.
2. Once deleted, click restore option.
3. You will see Error: "This value can not be null'.
Proposed resolution
1. Ideally if we are not checking validation before deleting the content then why on restore operation, because if node
is soft deleted , how can User fix the content based on valdation.
2. Validation error has no information regarding which field causing this issue.
Checked the code of EntityRestoreForm in which we are calling validation on entity before restore, which is causing this issue.
Possible Solution:
1. We can check validation before deleting with proper error message.
2. We can remove validation check on restore operation.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3571951.patch | 1.05 KB | shank115 |
| Screenshot from 2026-02-06 16-24-19.png | 18.93 KB | anurag_nagar |
Issue fork trash-3571951
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
shank115 commentedAdded
#limit_validation_errors = []to the submit button in EntityRestoreForm. This prevents the Form API from performing a full entity validation on fields that aren't present in the confirmation form.Comment #3
amateescu commented@shank115, that approach won't work because no fields are present on the restore form, which means it completely bypasses the work that was done in #3566494: Better handling of unique fields.
Comment #5
amateescu commentedOpened a MR with a solution that filters violations to only those coming from unique constraints.
Comment #6
amateescu commentedComment #9
amateescu commented