Taxonomy normalize task breaks with terms with the same name in different cultures
|Target version:||Release 2.3.0|
|Google Code Legacy ID:||Tested version:||2.0.0, 2.0.1, 2.1, 2.1.1, 2.1.2, 2.2, 2.3|
If a term has the same name in more than one culture, it's interpreted as a duplication in the task. Then after "moving" the object-term relations to itself, the task tries to delete it causing an error:
$ php symfony taxonomy:normalize "Physical object type" Normalizing for 'en' culture... Normalizing terms with name 'Contenedor'... Changing object term relations to term 145 to 145. Deleting term ID 145. Unable to execute DELETE statement. [wrapped: SQLSTATE: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`atom_dogwood`.`relation`, CONSTRAINT `relation_FK_4` FOREIGN KEY (`type_id`) REFERENCES `term` (`id`))]
The culture option that can be sent to the task (defaults to 'en') is used to fetch the taxonomy, but not the terms, so terms with the same name in different cultures will also be considered duplicates and deleted.
The culture should be used to fetch the terms too. So only duplicates with the same name in the selected culture should be deleted
#3 Updated by Dan Gillean over 6 years ago
- Requires documentation set to Yes
I think we should clarify the behavior in the task description in the documentation after this is done. Adding a note to myself to update the docs (here: https://www.accesstomemory.org/docs/2.3/admin-manual/maintenance/cli-tools/#taxonomy-normalization)
#8 Updated by Dan Gillean over 6 years ago
- Status changed from QA/Review to Verified
One small thing I noticed. I tried to normalize in french for the "Accession acquisition type" taxonomy - in the FR interface, it's called "Type d'entrée". I tried it a bunch of times with different capitalization, but kept getting an error message that no such taxonomy name existed in French. Eventually I removed the accent, and it worked. Do we sanitize all the names or something?