Validation constraints not respected

Created on 10 December 2020, almost 4 years ago

Problem/Motivation

Entity validation is not respected so that it is possible through bulk update fields to save entities, with invalid data, that could not have been saved individually in such a state.

Steps to reproduce

1.) Create a content type with a required field and a piece of content of that type
2.) Create a view which returns the content created in step 1, with a bulk operation and "Bulk Update Content Fields" selected
3.) Using the view, select the content created in step 1 and "Apply to selected items" the Bulk Update Content Fields
4.) Select the required field and hit next
5.) Set the value to empty/no choice and hit next/update fields
6.) Observe that the content is saved with no value in the required field.

Proposed resolution

Run validation prior to saving each entity in the batch process. If the entity fails validation, do not save it. Add error messages for each such entity.

Remaining tasks

User interface changes

Error status messages added for each failed save.

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dgroene

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024