Skip Navigation

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

Problem:
I am trying to change/add the language code in the development site but I faced the following error:

PHP Fatal error: Uncaught Error: Call to undefined method WP_Error::filter() in .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php:202

Solution:
The issue happened because the site's URL was changed, in this case, WPML will detect the change and show a banner asking if the site was moved/Copied to the new URL.

Kindly select if the site was moved to the current URL or if this is a copy of the main site then try again to add the language.

Relevant Documentation:
https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/using-advanced-translation-editor-when-you-move-or-use-a-copy-of-your-site/

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.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 10 replies, has 3 voices.

Last updated by campbellA-2 1 year, 6 months ago.

Assisted by: Mohamed Sayed.

Author Posts
October 24, 2022 at 6:29 am #12297425

campbellA-2

I am trying to change/add the language code in the development site but I faced WP_Error:filter error and I cannot proceed, can you help us with this?

wpml-languages.png
fatal-error.png
October 24, 2022 at 7:09 am #12297721

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

Before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.

Once a language has been created, it is not possible on WPML's interface to change the language. Can you please explain to us how did you change the language code?

Regards,
Itamar.

October 24, 2022 at 9:48 am #12298959

campbellA-2

Hello,

Apologies for the confusion - what I mean is that I tried to add new language based on the first screenshot I provided, I added it that way but when I click 'save' it appears to have a critical error when adding it. And the result when clicking 'save' is the second screenshot I provided.

Thanks,
Christian

October 24, 2022 at 11:03 am #12299623

Mohamed Sayed

Hi Christian,

Please go to WPML > Support > Troubleshooting page, then click the following:

- Clear the Cache in WPML
- Remove ghost entries from the translation tables
- Fix element_type collation
- Fix WPML table collation
- Set language information
- Fix post type assignment for translations

❌ Please make sure that you have a full database and website backup before trying the above ❌

If that didn't help, please try the following steps to install a fresh copy of the WPML plugin:

- Create a full database and website backup
- Access your site's root folder via FTP or cPanel
- Delete the current WPML plugin folder "sitepress-multilingual-cms" from the /wp-content/plugins/ directory
- Download a fresh copy from: https://wpml.org/account/downloads/
- Install it again from Plugins > Add new
- Activate it

Let me know please if that helps.

Regards,
Mohamed

October 25, 2022 at 3:07 am #12304279

campbellA-2

Hi, Mohamed.

Already done that steps/procedure you've said above but still having critical/fatal error when adding custom language in WPML -> Languages -> Edit languages -> Add languages. I follow this documentation https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/ on adding custom language. But still having errors when clicking 'save'. Can you please help me with this?

Thanks,
Christian

October 25, 2022 at 3:54 am #12304411

campbellA-2

Hi, Mohamed.

I hope this helps - this are the screenshot we've found and as well the result after following the steps/procedure you've advised. Still the error occurred. Please see the attached screenshot below.

Thanks,
Christian

version.png
fatal-error.png
image (5).png
October 25, 2022 at 9:03 am #12305683

Mohamed Sayed

Hi,

Could you please clear the cache then disable any Minify/Caching plugins temporarily and check if the issue is resolved?

If you still see the same issue, kindly check again in a minimal environment by following these steps:

- Deactivate all the plugins that are not related to WPML.
- Switch for a moment to a WordPress default theme like Twenty Twenty-one.
- If the issue is gone, activate one by one to see with which one there is an interaction issue.

❌ Please backup your database and website before performing the above test ❌

October 27, 2022 at 2:22 am #12319253

campbellA-2

Hello,

I already did the steps above that you've advised but still having issues/errors with adding custom language on WPML -> Languages -> Edit languages -> Add languages. The error is still the same and I cannot add a custom language. Please see attached screenshots below.

Thanks,
Christian

error.png
active-theme.png
active-plugins.png
October 27, 2022 at 8:03 am #12320989

Mohamed Sayed

Hi Christian,

I would need to request temporary access (WP-Admin and FTP) so I can investigate this issue further.
– preferably to a test site where the problem has been replicated if possible –

Your next answer will be private, which means only you and I have access to it.

❌ Please backup your database and website before providing us with access details ❌

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme and to change configurations on the site if needed. This is also a reason the backup is critical.

✙ I would also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Thanks for your cooperation

October 27, 2022 at 11:09 am #12323625

Mohamed Sayed

Hi,

It seems that WPML is detecting a change in your site’s URL, please check the WP dashboard and you'll see the banner in the attached screenshot.

Kindly select if the site was moved to the current URL or if this is a copy of the main site then try again to add the language. please check here for more details: https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/using-advanced-translation-editor-when-you-move-or-use-a-copy-of-your-site/

Let me know please if that helps so I can continue investigating the issue if that didn't help.

Screenshot_420.jpg
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.