Skip to content Skip to sidebar

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

Last updated by antonioC-92 2 months, 4 weeks ago.

Assisted by: Bobby.

Author Posts
October 30, 2025 at 7:25 pm #17534089

antonioC-92

Background of the issue:
I am trying to use the Elementor Pro Display Conditions feature while WPML Page Builders is active.

The page crashes with a 500 error.

Test URL: hidden link

I already applied the official workaround from this errata:
https://wpml.org/errata/fatal-error-triggered-when-using-display-conditions-for-elementor-widgets/

The error still occurs on:

WPML Multilingual CMS 4.8.4

Elementor Pro (insert exact version)

PHP (insert version)

The same page works fine when WPML Page Builders is deactivated.

Temporary workaround: returning an empty string for _elementor_conditions or normalizing it to valid JSON prevents the crash, confirming that WPML Page Builders still calls json_decode() on an array in DisplayConditions.php.

Symptoms:
The Elementor page should load normally with Display Conditions applied.

Instead, it triggers a 500 Internal Server Error.

PHP error log excerpt:

Fatal error: Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, array given
in /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php:110
Stack trace:
#0 DisplayConditions.php(110): json_decode(array)
#1 module.php(168): WPMLPBElementorHooksDisplayConditions->parseConditionJson()

This happens on multiple Elementor pages that use Display Conditions, not just one.

Questions:
Why does the page crash with a 500 error when using Elementor Pro Display Conditions with WPML Page Builders?

Has this issue been fully fixed in a newer WPML build than 4.8.4?

If not, could you please confirm the correct patch or file version of DisplayConditions.php that resolves this problem?

October 30, 2025 at 9:23 pm #17534438

antonioC-92

Elementor Version 3.32.5
Elementor Pro Version 3.32.3
PHP Version 8.3.26

October 30, 2025 at 9:41 pm #17534458

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Just to verify, you are using the latest version of WPML (4.8.4) correct?

Does the issue happen when using the 4.8.4 version ? This issue was resolved in an earlier version and the workaround is no longer needed.

IF you are using 4.8.4 and the issue persists, does the workaround from our Errata documentation work?

Awaiting your feedback!

October 30, 2025 at 9:51 pm #17534462

antonioC-92

I finally traced it down to a TypeError inside WPML’s Elementor Display-Conditions integration.
Problem
File:
…/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php
Line 110: json_decode() receives an array instead of the expected JSON string and PHP 8+ throws a fatal error.
Root cause
Elementor now passes the “display_conditions” value already decoded (array).
WPML still assumes it is a JSON string and calls json_decode() without any type check.
Quick fix (until an official patch)
Edit the private helper parseConditionJson() as follows:
php
Copy
private function parseConditionJson( $json ) {
// Already an array – nothing to decode
if ( is_array( $json ) ) {
return $json;
}
// Fall-back for real JSON strings
return is_string( $json ) ? json_decode( $json, true ) : [];
}
Save the file, clear any cache, the 500 disappears immediately.
Environment
WPML 4.7.2 (all CMS packages)
Elementor 3.25.3 + Elementor Pro 3.25.2
PHP 8.1
WordPress 6.7
Could you add the same guard in the next release so other users don’t hit the same fatal error?
Thanks for the great support and keep up the good work!
Best,
Antonio