Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are experiencing a recurring issue with the WPML plugin where after translating pages and posts, the backend functionality of your site gets corrupted, and the file admin-ajax.php throws a 500 error. The error log indicates a fatal error related to a function call on a null object within the WPML plugin's code.
Solution:
We have identified that the issue might be related to the PHP version compatibility with WordPress. Currently, your site is running on PHP version 8.3, which has only Beta support in WordPress. We recommend switching to a stable and compatible PHP version, such as 7.4 or 8.0, to see if this resolves the issue. You can check the PHP compatibility details with WordPress at this link.

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your case, please open a new support ticket. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, you can contact us directly at WPML support forum.

0% of people find this useful.

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 1 reply, has 2 voices.

Last updated by Prosenjit Barman 10 months, 3 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
June 8, 2024 at 12:51 am #15717947

amiraK

Good morning.
I am experiencing a recurring issue with the WPML plugin.
After finishing the pages and posts translation, the site gets corrupted in the backend functionality, as the file hidden link throws a 500 error.
Here are the details of the error.

[08-Jun-2024 00:48:10 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_object_id() on null in /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php:381
Stack trace:
#0 /home/shafcenter/public_html/wp-includes/class-wp-hook.php(324): wpml_object_id_filter('1', 'post')
#1 /home/shafcenter/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('1', Array)
#2 /home/shafcenter/public_html/wp-content/plugins/masterstudy-lms-learning-management-system/_core/lms/helpers.php(1130): apply_filters('wpml_object_id', '1', 'post')
#3 /home/shafcenter/public_html/wp-content/plugins/masterstudy-lms-learning-management-system/_core/lms/helpers.php(1148): ms_plugin_user_account_url('edit-course')
#4 /home/shafcenter/public_html/wp-content/plugins/masterstudy-lms-learning-management-system/_core/lms/admin_helpers.php(190): ms_plugin_manage_course_url()
#5 /home/shafcenter/public_html/wp-includes/class-wp-hook.php(326): {closure}('hidden link...', '')
#6 /home/shafcenter/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters('hidden link...', Array)
#7 /home/shafcenter/public_html/wp-includes/link-template.php(3575): apply_filters('admin_url', 'hidden link...', '', NULL, 'admin')
#8 /home/shafcenter/public_html/wp-includes/link-template.php(3541): get_admin_url(NULL, '', 'admin')
#9 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/utilities/class-wpml-ajax.php(9): admin_url()
#10 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/query-filtering/class-wpml-term-display-as-translated-adjust-count.php(35): WPML_Ajax::is_frontend_ajax_request()
#11 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(285): WPML_Term_Display_As_Translated_Adjust_Count->__construct(Object(SitePress), Object(wpdb))
#12 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/auryn/lib/Injector.php(444): SitePress->__construct()
#13 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/auryn/lib/Injector.php(417): WPML\Auryn\Injector->instantiateWithoutCtorParams('\\SitePress')
#14 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/auryn/lib/Injector.php(373): WPML\Auryn\Injector->provisionInstance('\\SitePress', 'sitepress', Array)
#15 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php(98): WPML\Auryn\Injector->make('\\SitePress', Array)
#16 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/container/functions.php(29): WPML\Container\Container::make('\\SitePress', Array)
#17 [internal function]: WPML\Container\{closure}('\\SitePress')
#18 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array(Object(Closure), Array)
#19 [internal function]: WPML\FP\{closure}('\\SitePress')
#20 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/container/functions.php(35): call_user_func_array(Object(Closure), Array)
#21 /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/sitepress.php(176): WPML\Container\make('\\SitePress')
#22 /home/shafcenter/public_html/wp-settings.php(517): include_once('/home/shafcente...')
#23 /home/shafcenter/public_html/wp-config.php(80): require_once('/home/shafcente...')
#24 /home/shafcenter/public_html/wp-load.php(50): require_once('/home/shafcente...')
#25 /home/shafcenter/public_html/wp-admin/admin-ajax.php(22): require_once('/home/shafcente...')
#26 {main}
thrown in /home/shafcenter/public_html/wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php on line 381

June 10, 2024 at 6:48 am #15720217

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

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

Hi There,
Thanks for contacting WPML Support. Sorry for the delay in responding due to the weekend.

I understand the issue you're experiencing. Upon reviewing the WPML Debug info, I noticed that the site is currently running on PHP version 8.3. For your information, WordPress offers Beta support for PHP 8.2 and 8.3, while PHP 8.0 and 8.1 are marked as compatible, though exceptions may occur. You can view the PHP compatibility details with WordPress at this link.

Therefore, the issue you encountered could be related to PHP compatibility. Could you please switch to a stable and compatible version, such as PHP 7.4 or 8.0, and check if the issue persists?

Please let me know the update. I'll be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

June 17, 2024 at 3:44 am #15743161

amiraK

Thank you
Regards The issue has been resolved by wiping the data from every WPML table. Since the logs consistently relate to the file of the plugin that does the query, all I need to do is locate the record or table that is problematic.