Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Madrid (GMT+02:00)

This topic contains 6 replies, has 0 voices.

Last updated by Marcel 4 weeks ago.

Assisted by: Marcel.

Author Posts
May 1, 2025 at 1:40 pm #16986657

andyZ-4

Background of the issue:
I was trying to update WPML to version 4.7.4, but after the update, we encountered a PHP Fatal Error. We experienced this error with Elementor version 3.27.6 and Elementor version 3.28.4. We have a private environment where the error can be seen. If you'd like access, please let us know. Link to a page where the issue can be seen: hidden link. PHP Fatal error: 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:138

Symptoms:
After updating WPML to version 4.7.4, we observed a PHP Fatal Error: 'PHP Fatal error: 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:138'. The full stack trace was provided.

Questions:
How can we resolve the PHP Fatal Error after updating WPML to version 4.7.4?
Is there a compatibility issue between WPML version 4.7.4 and Elementor versions 3.27.6 and 3.28.4?

May 2, 2025 at 2:24 pm #16989933

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

Thank you for bringing this to my attention. I’m not aware of any existing reports of the issue. As a first step, let’s disable the third-party Elementor add-ons to see whether one of them is causing the problem.

I would eventually also need to request temporary access (WP-Admin and FTP) to your site
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed

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

❌ Please backup your database and website ❌

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

✙ Please add the Links to the […] Edit Screen, the Page/Post where you insert the […] and the corresponding Front End Page/Screen

Best Regards,
Marcel

May 5, 2025 at 6:24 am #16994374

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

No real e-mail address is required. As you provide the data in our input fields, you can simply enter something like noreply@yourdomain.com or noreply@wpml.org to grant access.

Best regards,
Marcel

May 5, 2025 at 3:35 pm #16997135

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi Marcel,

I'm unable to confirm an error originating from WPML. The original language page exhibits the same fatal error even with WPML deactivated and the specific code from the error stack trace you mentioned disabled.

Could you please confirm this observation?

Best regards,
Marcel

May 5, 2025 at 6:15 pm #16997833

andyZ-4

I'm not able to confirm that. I see the error on this page: hidden link.

When WPML is deactivated, there is a PHP fatal error, but it's a different fatal error. I have corrected that error, so that you can now see that the fatal error is present only when WPML is activated.

May 6, 2025 at 3:30 pm #17002637

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi there,

If you’re seeing a PHP error while WPML is turned off, the source must be elsewhere in your site’s code. Please review the debug.log to identify and fix that underlying issue before re-enabling WPML.

This underlying issue can also conflict later once WPML is running and active.

Best regards,
Marcel

May 6, 2025 at 7:00 pm #17003317

andyZ-4

I am not seeing a PHP error while WPML is turned off.

As I said, there was a PHP error when WPML is turned off, but I have corrected that error. Now there is no PHP error when WPML is turned off. There is only an error when WPML is turned on.

May 8, 2025 at 1:28 pm #17012009

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Madrid (GMT+02:00)

Hi,

please 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;
	}

Does this temporary workaround work for you?

Best Regards,
Marcel

The topic ‘[Closed] Elementor Integration Fatal Error: cannot access offset of type string on string’ is closed to new replies.