Skip Navigation

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

Problem:
You are experiencing a fatal error on your homepage after upgrading PHP from 7.4 to 8.2 or 8.4 while using WPML with Elementor. The error message indicates an issue with accessing an offset of type string on string in the WPML Page Builders integration for Elementor.
Solution:https://wpml.org/forums/topic/fatal-error-with-wpml-page-builders-and-elementor-on-php-8-2/#post-17010735

If this solution does not resolve your issue or seems irrelevant due to updates or differences in your setup, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket.

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 8 replies, has 0 voices.

Last updated by Shekhar Bhandari 2 weeks ago.

Assisted by: Shekhar Bhandari.

Author Posts
May 6, 2025 at 9:15 am

antonioC-92

Background of the issue:
I am trying to use WPML with Elementor on PHP 8.2. After switching the PHP version from 7.4 to 8.2 (and also 8.4), the homepage throws a fatal error related to WPML Page Builders integration.

Symptoms:
A fatal error occurs: 'Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php on line 138'. The stack trace includes functions like convertConditionIds(), convertCondition(), processDisplayConditions(), convertDisplayConditions(), Elementor → get_content(), ElementorPro Theme Builder → print_content(), and header.php → homepage crash.

Questions:
Why does the homepage throw a fatal error when using WPML with Elementor on PHP 8.2?
How can I resolve the fatal error related to WPML Page Builders integration?

May 6, 2025 at 10:27 am
May 6, 2025 at 11:04 am #17001125

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Just to let you know, I have escalated this issue to our 2nd tier supporters, I will update you as soon as I receive further feedback from them.

Thanks

May 7, 2025 at 8:36 am #17005018

antonioC-92

Hi Shekar, is there any news?

I need to upgrade the system to PHP > 8.2 and it seems that this error in WPML is the only obstacle at the moment.

I am staying tuned

May 7, 2025 at 12:00 pm #17006306

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello,

There is currently no news regarding the issue. The matter is still in our second-tier queue. I will update you as soon as I receive any feedback from them.

Thank you,

May 8, 2025 at 7:09 am #17009985

antonioC-92

Hi Shekhar,
this issue is very important, and today it seems that WPML is the only impediment to the development of our website.

Would you be able to get visibility on when your bug will be fixed?

I'll stay tuned,
AC

May 8, 2025 at 7:20 am #17010011

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello,

I am writing to inform you that one of our second-tier support representatives is currently investigating the issue. While the duration of the debugging process is uncertain, I will provide updates as soon as I receive any feedback from the representative.

Thank you for your patience.

May 8, 2025 at 10:00 am #17010735

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

The issue is now escalated to our developers team, in the meantime, as a workaround, please follow the below steps:

- edit the file sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/Hooks/DisplayConditions.php, locate the function convertConditionIds (from line 134 in current versions), and replace the function with this code:

	private function convertConditionIds( array $conditionGroups ) {

		// ensure $conditionGroups is an array of arrays and not just an associative array
		$result = array_keys($conditionGroups)[0] !== 0 ? array($conditionGroups) : $conditionGroups;

		foreach ( $result as $key => $conditionGroup ) {
			$configForCondition = $this->getConfigForCondition( $conditionGroup['condition'] );

			if ( $configForCondition && isset( $conditionGroup[ $configForCondition['field'] ] ) ) {
				$result[ $key ] = $this->convertIdsForCondition( $conditionGroup, $configForCondition );
			}
		}

		return $result;
	}

Let me know if this helps.

Thanks

May 9, 2025 at 6:02 am #17014582

antonioC-92

Hi, I applied this workaround and was able to upgrade to PHP version 8.4.
Thank you for this temporary fix.

Will the final fix be released in the next official update?

May 9, 2025 at 7:38 am #17014844

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

It will take time for the final fix to be released, you can monitor this errata page to see when the fix will be released.

https://wpml.org/errata/fatal-error-triggered-when-using-display-conditions-for-elementor-widgets/

Thanks