Skip Navigation

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.

Check this response: https://wpml.org/forums/topic/critical-error-while-trying-to-export-a-xliff-file-happening-on-php-8-only/#post-13954805

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by mariaA-45 1 year, 10 months ago.

Assisted by: Prosenjit Barman.

Author Posts
July 3, 2023 at 5:45 am #13930207

mariaA-45

Hi there,
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
Stack trace:
#0 /var/www/develobaby.com/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/xliff/class-wpml-tm-xliff-frontend.php(393): wpml_zip->sendZip('DeveloBaby-tran...')
#1 /var/www/develobaby.com/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/xliff/class-wpml-tm-xliff-frontend.php(196): WPML_TM_Xliff_Frontend->stream_xliff_archive(Object(wpml_zip))
#2 /var/www/develobaby.com/public_html/wp-includes/class-wp-hook.php(308): WPML_TM_Xliff_Frontend->init('')
#3 /var/www/develobaby.com/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
#4 /var/www/develobaby.com/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /var/www/develobaby.com/public_html/wp-settings.php(623): do_action('init')
#6 /var/www/develobaby.com/public_html/wp-config.php(249): require_once('/var/www/develo...')
#7 /var/www/develobaby.com/public_html/wp-load.php(50): require_once('/var/www/develo...')
#8 /var/www/develobaby.com/public_html/wp-admin/admin.php(34): require_once('/var/www/develo...')
#9 {main}
thrown in /var/www/develobaby.com/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/wpml_zip.php on line 498

This happens with PHP 8.0, 8.1 and 8.2, but not with 7.4

Any tricks to make this work with PHP8?

July 3, 2023 at 6:29 am #13930269

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,

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.

Best Regards,
Prosenjit

July 6, 2023 at 5:53 am #13954805

mariaA-45

For the others out there,

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.

Thanks
Maria