Home›Support›English Support›[Resolved] Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
[Resolved] Deprecated: mb_strlen(): Passing null to parameter #1 ($string) of type string is deprecated
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.
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'
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.
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).
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.
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.