Tổng quan về sự cố
Nếu bạn đang chỉnh sửa một bài viết thông qua giao diện người dùng và bài viết đó đã được nhân bản sang các ngôn ngữ khác thông qua lập trình, bạn có thể gặp lỗi như sau:
PHP Fatal error: Uncaught Error: Call to a member function get_translation_job() on null in wp-contentpluginswpml-translation-managementinctranslation-jobshelperswpml-translation-job-helper-with-api.class.php:15 Stack trace: #0 wp-contentpluginswpml-translation-managementinctranslation-jobshelperswpml-update-post-translation-data-action.class.php(12): WPML_Translation_Job_Helper_With_API->get_translation_job(NULL) #1 wp-contentpluginswpml-translation-managementinctranslation-jobshelperswpml-update-translation-data-action.class.php(84): WPML_TM_Update_Post_Translation_Data_Action->populate_prev_translation(1020, Array) #2 wp-contentpluginswpml-translation-managementinctranslation-jobshelperswpml-update-translation-data-action.class.php(33): WPML_TM_Update_Translation_Data_Action->get_translated_field_values(1020, Array) #3 wp-contentpluginswpml-translation-managementincactionswpml-tm-action-helper.class.p in wp-contentpluginswpml-translation-managementinctranslation-jobshelperswpml-translation-job-helper-with-api.class.php on line 15
Giải pháp tạm thời
Sự cố này đã được khắc phục trong WPML Translation Management 2.10.4. Việc cập nhật giải quyết vấn đề này trên trang web của bạn, vì vậy bạn chỉ cần giải pháp tạm thời này nếu chưa thể cập nhật.
Hãy đảm bảo rằng bạn biết mình đang làm gì và đã tạo bản sao lưu trước!
Thông qua FTP client hoặc bảng điều khiển hosting của bạn, hãy thử chỉnh sửa tệp tại /wp-content/plugins/wpml-translation-management/inc/translation-jobs/helpers/wpml-translation-job-helper-with-api.class.php
Thay thế hai dòng sau:
global $wpml_translation_job_factory; return $wpml_translation_job_factory->get_translation_job( $job_id, $include_non_translatable_elements, $revisions );
return wpml_tm_load_job_factory()->get_translation_job( $job_id, $include_non_translatable_elements, $revisions );