- Issue created by @mtalt
- Merge request !30Fixes an issue where an entity could not be deleted if the document had been deleted in the TMS β (Open) created by mtalt
I am unable to delete content if a document is not found in the TMS. When an entity is deleted, an attempt
to cancel the document in the TMS is made. If the document is not found in the TMS, a LingotekDocumentNotFoundException is thrown, which is not caught in lingotek_entity_delete(). The result is that the entity cannot be deleted because this error occurs:
Drupal\Core\Entity\EntityStorageException: Document [document_id] not found. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (line 763 of /app/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
The issue can also occur if different Lingotek projects are used across different environments. For example, for our local/dev environments, we use a different Lingotek project, workflow, and vault. Pulling databases from production can result in a document not existing in the current Lingotek project.
In lingotek_entity_delete(), catch the LingotekDocumentNotFoundException and log a warning to the logs. If there is no document found in the TMS, we should be able to delete the Drupal entity safely.
Active
4.1
Code