Home›Support›English Support›[Resolved] Critical Error while trying to Export a XLIFF file [Happening on PHP 8 only]
[Resolved] Critical Error while trying to Export a XLIFF file [Happening on PHP 8 only]
This thread is resolved. Here is a description of the problem and solution.
Problem:
I'm trying to export XLIF content, but the export fails and I see the following stack trace:
2023-07-03T05:39:45+00:00 CRITICAL Uncaught Exception: Unable to send file 'DeveloBaby-translation-job-27.zip'. Headers have already been sent from '/var/www/develobaby.com/public_html/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/tm/class-wpml-tm-page-builders-field-wrapper.php' in line 121 in /var/www/develobaby.com/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/wpml_zip.php:498
Solution:
If you're exporting a cliff file, make sure that the XLIFF of the post/page that you're exporting is not translated. If you're translating the page/post, make sure to fully translate it otherwise leave it untranslated.
As we have discussed in the chat, here is your ticket. Please let me know your findings in response to the ticket. I will be happy to assist you if you need further assistance in this matter.
the issue resolved itself without me doing anything. No plugin updates came in and no other site changes have happened since I opened the ticket.
During the initial chat, support helped me track down that this happened only to pages that were partly translated, i.e. not to pages that were fully translated or not translated, at all. As soon I fully translated the artly translated pages, the issue went away. Support mentioned also that blanks (i.e. " ") in certain places can cause the exporter to throw this error. Perhaps the blanks in the wrong places were removed during translation (unintentionally).
My take away: either translate yourself the whole page or don't translate anything, if (IF) you plan to export to XLIFF later on.