Problem/Motivation

When the XTM project option "File join on" is enabled, translations cannot be imported back to the Drupal source site with the following message (@see screenshot).

Could not read XTM file

As a result of some deep and granular debugging it looks (to me) that this might be a .zip parsing issue, happening here: https://git.drupalcode.org/project/tmgmt_xtm/-/blob/8.x-5.x/src/Plugin/t...

In the case of "File join off" every single zip file being fetched and unzipped by that script contains one .xml file, that is directly parsed and being set as $content.

In case of "File join on" instead the fetched zipped file contains a folder with all the language translations contexts xml files.
The result/return of this:

$zip = @fopen('zip://' . $filePath, 'r');

is empty because it is a folder, and not an XML file. Hence the tryToGetXMLFromZip returns an empty content and then this excpeption is triggered:

https://git.drupalcode.org/project/tmgmt_xtm/-/blob/8.x-5.x/src/Plugin/t...

(@see the screenshot)

Requested/proposed resolution:

If the described scenario is indeed the cause of this bug then:
- (may be?) the XTM callback should be able to understand when an incoming "File join on" request is being managed;
- (for sure) extend the readZipArchive to intercept it as a un-zipped folder and correctly cycle into its contents and return the content parsing (and joining?) the inner XML files ...

Comments

itamair created an issue. See original summary.

itamair’s picture

StatusFileSize
new328.39 KB
itamair’s picture

Title: When the XTM project option File join on is enabled, translations to do not return to the server. » When the XTM project option File join on is enabled, translations to do not return to the Drupal source ("Could not read XTM file")
itamair’s picture

Title: When the XTM project option File join on is enabled, translations to do not return to the Drupal source ("Could not read XTM file") » When the XTM project option "File join on" is enabled, translations to do not return to the Drupal source ("Could not read XTM file")
itamair’s picture

Issue summary: View changes
pjassem’s picture

Assigned: Unassigned » pjassem
Status: Active » Fixed

This has been fixed in the latest release: 8x.-5.0

Status: Fixed » Closed (fixed)

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