- Issue created by @ohadm
The module does not look for fields with 'UniqueField' constraint set on them and tries to clone them as-is without updating such fields and that causes the clone process to fail on 'duplicate entry' error on DB level and the module to be unusable on such entities.
1. Create a new content type or update an existing one.
2. Add a new field.
3. Set a 'UniqueField' constraint on it using code.
e.g.:
$fields['my_uuid'] = BaseFieldDefinition::create('uuid')
->setLabel(t('UUID'))
->addConstraint('UniqueField', [])
->setDefaultValue(FALSE)
->setReadOnly(TRUE);
4. Create a new node using the updated content type.
5. Try to use the module to clone it.
Detect fields with such a constraint and allow the user to clone the data of the original field with a change so it will stay unique and allowed to be cloned at the same time.
Active
2.1
Code