Attempting to delete Term that is used in existing Relationships causes 500 server error and prematurely removes term from Elasticsearch
|Google Code Legacy ID:||Tested version:||2.5|
If a user attempts to delete a Term that is actively associated to authority records in the Relation table, deleting the term from the database fails due to foreign key constraints and a 500 Server Error is thrown. Sample log output:
PHP message: Unable to execute DELETE statement. [wrapped: SQLSTATE: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (atomDev.relation, CONSTRAINT relation_FK_4 FOREIGN KEY (type_id) REFERENCES term (id))]
In addition, the term is removed from the Elasticsearch despite not being deleted from the database, which makes it no longer appear in search results on the appropriate taxonomy page (Browse Actor Relation, in my case) despite the deletion not being successful.