Problem/Motivation
When translations are submitted to Smartling, the module generates two XML files, one in [schema]//tmgmt_sources/ and another in [schema]//tmgmt_smartling_translations/. These files are managed files. When the job entity is deleted, the files are not deleted.
What is the expectation for XML file clean up?
Steps to reproduce
- Run a translation job.
- Verify the XML files are downloaded to the file system.
- Delete the translation job.
- Observe the XML files are not removed.
- Run cron (maybe there's a clean-up task).
- Observe the XML files are not removed.
E.g. Here's example data from the file_managed table for a file associated to a deleted job:
mysql> select * from file_managed where filename LIKE "%JobID201_en_es.xml%";
+-------+--------------------------------------+----------+------+--------------------+----------------------------------------------------------+-----------------+----------+--------+------------+------------+
| fid | uuid | langcode | uid | filename | uri | filemime | filesize | status | created | changed |
+-------+--------------------------------------+----------+------+--------------------+----------------------------------------------------------+-----------------+----------+--------+------------+------------+
| 61556 | c84c4bb9-42ae-4a84-8e9a-8f14a694f75a | en | 66 | JobID201_en_es.xml | public://tmgmt_sources/JobID201_en_es.xml | application/xml | 1080 | 1 | 1706822203 | 1706822203 |
| 61561 | c3be36fb-4ac4-4604-891d-49ed07078a28 | en | 0 | JobID201_en_es.xml | public://tmgmt_smartling_translations/JobID201_en_es.xml | application/xml | 1113 | 1 | 1706822280 | 1706822280 |
+-------+--------------------------------------+----------+------+--------------------+----------------------------------------------------------+-----------------+----------+--------+------------+------------+
2 rows in set (0.03 sec)
Note that status for each file is 1, which indicates a permanent file.
Proposed resolution
TBD
Remaining tasks
TBD
User interface changes
TBD
API changes
None anticipated
Data model changes
None anticipated
Comments
Comment #2
loparev commentedHi, thanks for the report. We will plan a fix for this. It can be implemented as tmp file autoclean up or even clean up after request/download translation.
Comment #5
loparev commentedReleased https://www.drupal.org/project/tmgmt_smartling/releases/8.x-9.20