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?
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
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.
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.
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.
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.
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.
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;
}
The topic ‘[Closed] Elementor Integration Fatal Error: cannot access offset of type string on string’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.