Skip Navigation

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

Problem:
If you're trying to edit a translated page and encounter the error 'Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated', this is likely due to incompatibilities with PHP 8.2.
Solution:
We recommend you try the following steps:
1. Go to the affected page and make a minor modification to the content in the original language.
2. Attempt to translate the page again to see if the issue is resolved.

Please note that WordPress has known incompatibilities with PHP 8.2, which can cause warnings like this to appear. We have added your ticket to our internal tracking system and will address the issue in a future update. Keep an eye on our changelog for updates: WPML Changelog.

If this solution doesn't look relevant to your situation, please open a new support ticket in our forum: WPML Support Forum.

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

Last updated by Mateus Getulio 1 year, 4 months ago.

Assisted by: Mateus Getulio.

Author Posts
January 10, 2024 at 12:47 pm #15168890

kristenQ

I'm trying to edit a translated page on our dev site and I keep getting the error 'Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /nas/content/live/smartfactordev/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php on line 154'

January 11, 2024 at 10:57 am #15173450

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks for your patience.

So that we can take a better look at this issue, may I kindly ask you to provide us with:

- a website package where we can reproduce the problem (or the credentials for a staging website)
- the exact step-by-step in order to reproduce it (mainly what is the page having the problem)
- any possible trigger you have noticed (besides the php version)

Please use the plugin Duplicator(hidden link) to create a full copy of your website so we can take a look at it and see what's causing the issue.

Please check our tutorial on how to create a Duplicator package here: https://wpml.org/faq/provide-supporters-copy-site/

If you come across problems while creating it, please feel free to ignore(exclude from the backup) both uploads and cache folders.

I'm enabling the proper field for your to share this copy, you'll see it on your next response.

Alternatively, you may use any file sharing service that you prefer and share the link in the ticket(your next response is being marked as private, only you and I have access to it).

Thank you, please let me know.

January 11, 2024 at 4:21 pm #15175858

Mateus Getulio
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks for providing the credentials.

It seems the problem is solved if we follow the steps I asked you to try in the chat previously:

- Go to your affected page, and do a minor modification to the original language content
- Try to translate that page again and see if it'll work fine this time

Even using php 8.2. Therefore, may I kindly ask you to stick to this solution? Besides this, and downgrading php, you can also set the WP_DEBUG constant to false, in the wp-config.php file:

define('WP_DEBUG', false);

We can see it is set to true right now, and this causes the displaying of the warning in the WP dashboard.

At last, it is necessary to emphasize again that the WordPress team itself indicates some known incompatibilities with PHP 8.2: https://make.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/. So it is expected to see those warnings once in a while.

Regardless, your ticket is added to the threads list in our internal tracking, and as soon as possible we'll fix the issues in this php version. Please stay tuned in our changelog: https://wpml.org/download/wpml-multilingual-cms/?section=changelog

Thanks for your understanding.