Automatic entity label does not take into account the field constraints

Created on 24 January 2022, almost 3 years ago
Updated 30 November 2024, about 1 month ago

Problem/Motivation

After install taxonomy_unique, we can not change the name/title of terms with the same name field because the constraint from taxonomy_unique checks if the name already exists before auto_entitylabel updates this value.

Any constraint validation will be against the old name value.

The auto_entitylabel seems that update the label on the hook insert/presave so seems to me that any validation on the name field will be ignored.

Proposed resolution

Maybe it should done in the form submit/validation instead on the hook presave/insert.
A good solution could be using entity builders, which is a function called before validation https://git.drupalcode.org/project/drupal/-/blob/2e7b6ca227f23820be4638d...

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇪🇸Spain eduardo morales alberti Spain, 🇪🇺

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.

Production build 0.71.5 2024