Skip Navigation

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

Problem:
When a member tries to login, they see the following fatal error:

Fatal error: Uncaught TypeError: Argument 2 passed to WPML_User_Language::update_user_lang_from_login() must be an instance of WP_User, string given, called in ********/public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php on line 15

Solution:
It looks like a compatibility issue with the member login plugin, the member login widget is most probably calling the wp_login hook:
https://developer.wordpress.org/reference/hooks/wp_login/
But it's not passing a WP_User instance as a second parameter.

Please note that the "Membee Login" plugin is not listed on the WPML compatibility list for the plugins - https://wpml.org/plugin/. This means that our compatibility team has not tested it.

So we suggest contacting the plugin author and sharing the issue with them, probably they can provide a quick fix.

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.

This topic contains 4 replies, has 2 voices.

Last updated by cindyL-2 2 years, 11 months ago.

Assisted by: Mohamed Sayed.

Author Posts
March 28, 2022 at 10:39 pm #10897411

cindyL-2

When a member enters their name and password and clicks submit, they see a fatal error. Please see attached image for details of the error.

Steps to recreate:

* Go to hidden link
-- Removed by Supporter --
* Expect to be redirected, but see the attached error.
* Go back to the home page and see that the login was successful, in spite of the error.

I expected to see:

Instead, I got:

Screenshot 2022-03-28 150730.png
March 29, 2022 at 11:44 am #10901493

Mohamed Sayed

Hi Cindy,
Thanks for contacting WPML support.

Please follow these steps in order to isolate the cause of the issue:

- Create a staging site with a copy of the live site
- Update any outdated plugins or themes
- Flush the cache memory
- Deactivate all plugins, except WPML ones
- Activate a default WordPress theme, like Twenty Twenty-one
- If the issue disappeared, start by activating the theme and then the plugins, one by one, until the issue appears again and you find the culprit.

Could you tell me the results of the steps above?

Regards,
Mohamed

March 30, 2022 at 8:46 pm #10914705

cindyL-2

Hi Mohamed,

I've deactivated all other plugins (except for the login plugin which is required to make the site work), and confirmed the fatal error is still coming up.

Unfortunately, it's not possible to test this issue with another theme because the site is using Avada.

Could you shed some light on what this is in the fatal error: "Argument 2 passed to WPML_User_Language::update_user_lang_from_login()" or take a closer look for us?

Note: We use the same plugins on many sites and this site is the only one experiencing the fatal error.

March 31, 2022 at 4:36 pm #10923005

Mohamed Sayed

Hi Cindy,

I couldn't find any clues regarding this error, so I've consulted our 2nd tier support developers about it.

They checked the site and mentioned that it sounds like a compatibility issue with the member login plugin, the member login widget is most probably calling the wp_login hook:
https://developer.wordpress.org/reference/hooks/wp_login/
But it's not passing a WP_User instance as a second parameter.

Please note that the "Membee Login" plugin is not listed on the WPML compatibility list for the plugins - https://wpml.org/plugin/. This means that our compatibility team has not tested it.

So we suggest contacting the plugin author and sharing the issue with them, probably they can provide a quick fix.

Also, you can ask them to join our Go Global program so our compatibility team can work with them to make the plugin compatible with WPML, they can contact us with this link: https://wpml.org/documentation/support/go-global-program/

Regards,
Mohamed