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...
Issue fork auto_entitylabel-3260103
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
eduardo morales albertiComment #4
eduardo morales albertiI forgot to add the !$decorated_entity->isTitlePreserved(), lets see if the tests now passed
Comment #5
giuseppe87 commentedIf the node has a media field, opening it causes the following error:
InvalidArgumentException: Field {$field_name} node is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 587 of /var/www/html/web/core/lib/Drupal/Core/Entity/ContentEntityBase.php).Most probably it would be have the same problem with other ajax field.
Comment #6
giuseppe87 commentedComment #7
eduardo morales albertiComment #8
benstallings commentedNeeds to be rebased on the current 8.x-3.x branch -- pretty complex, more than I can handle!