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 ...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Screenshot 2021-02-22 at 10.34.18.png | 328.39 KB | itamair |
| Screenshot 2021-02-22 at 10.17.14.png | 276.99 KB | itamair |
Comments
Comment #2
itamair commentedComment #3
itamair commentedComment #4
itamair commentedComment #5
itamair commentedComment #6
pjassem commentedThis has been fixed in the latest release: 8x.-5.0