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

  1. Run a translation job.
  2. Verify the XML files are downloaded to the file system.
  3. Delete the translation job.
  4. Observe the XML files are not removed.
  5. Run cron (maybe there's a clean-up task).
  6. 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

chris burge created an issue. See original summary.

loparev’s picture

Hi, 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.

  • loparev committed 6c7c22b8 on DRUP-342-remove-job-files-after-job-deletion
    Issue #3553952 by chris burge, loparev: XML Files Not Cleaned up Upon...

  • loparev committed 6c7c22b8 on 8.x-9.x
    Issue #3553952 by chris burge, loparev: XML Files Not Cleaned up Upon...
loparev’s picture

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.