Skip Navigation

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

Problem:
The client was experiencing 500 errors with the ajax-based quick search bar in the Flatsome theme. The debug log indicated a fatal error with the

get_requested_lang()

function in the WPML plugin.
Solution:
We asked the client to confirm the version of the Flatsome theme they were using and suggested updating to the latest version if they were not on version 3.18.2. The client discovered that the issue was caused by the Query Monitor plugin, which nullified the

get_requested_lang()

function. They found a workaround by clearing the

wpml_notices

key in the

wp_options

table, as suggested in a WPML forum post: https://wpml.org/forums/topic/query-monitor-conflicts-with-wpml-and-yith-wishlist-plugin/#post-11521481.

If this solution does not seem relevant to your situation, please feel free to open a new support ticket with us here.

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

Last updated by Bruno Kos 1 year, 1 month ago.

Assisted by: Bruno Kos.

Author Posts
December 19, 2023 at 11:00 am #15091537

Károly Farkas

Hello,

I am using flatsome theme, which has an ajax-based quick search bar. It worked ok, but recently it causes 500 errors. According to the debug log:

PHP Fatal error: Uncaught Error: Call to a member function get_requested_lang() on null in /.../wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php:1131

Please help me find what changed and causing the error.

December 20, 2023 at 4:09 pm #15104621

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Thank you for contacting WPML support!

Can you tell me which Flatsome version do you have? Do you have 3.18.2 perhaps?
hidden link

If not, can you update and check then?

Regards,
Bruno Kos

December 22, 2023 at 9:25 am #15115223

Károly Farkas

Hi,
yes, we're using 3.18.2

December 22, 2023 at 9:58 am #15115621

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

I see - can you install the latest Flatsome here:
hidden link

And tell me if you see the same issue here? If some content is needed required for the search, such as one simple page or post, please set it.

Let me know if you have questions or need assistance!

December 29, 2023 at 8:06 am #15136026

Károly Farkas

Thank you for the staging environment. I could not test it yet, since I'm on vacation, but I'm willing to test it as soon as I return to work. Thank you for your patience.

January 2, 2024 at 8:01 am #15140332

Bruno Kos
Supporter

Languages: English (English ) German (Deutsch ) French (Français )

Timezone: Europe/Zagreb (GMT+01:00)

Sounds like a plan, enjoy your vacation!

January 4, 2024 at 1:33 pm #15150720

Károly Farkas

Hello Bruno,

The issue was not present on the testing environment, however I found the solution. The issue was caused by query monitor plugin, which nulled the get_requested_lang() function for some reason. I found a workaround here, which solved the problem: https://wpml.org/forums/topic/query-monitor-conflicts-with-wpml-and-yith-wishlist-plugin/#post-11521481
(I had to clear wpml_notices key in wp_options table)

Thank you for your assistance.