emiliH
Background of the issue:
I am trying to translate my site using WPML and WPBakery. I expected to see the translation page to translate my strings.
Symptoms:
Instead, I got a PHP Fatal error: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, array given in /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/dynamic-content.php:81.
Questions:
How can I resolve the PHP Fatal error related to substr() in the WPML plugin?
Andrey
WPML Supporter since 06/2013
Languages:
English (English )
Russian (Русский )
Timezone:
Europe/Kyiv (GMT+03:00)
Hi, this is Andrey. I'll be assisting you further.
Could you please update your WPBakery Page Builder plugin to version 8.6.1?
Release Notes / Changelog:
hidden link
If the issue persists after updating, try temporarily disabling all plugins except WPML and WPBakery Page Builder to test the problem further.
Please let me know how it goes. Don't forget to take a full backup before proceeding.
emiliH
Hi, Thanks. I updated to 8.0.1, but still the same issue.
The error is the same:
Error Details
=============
An error of type E_ERROR was caused in line 81 of the file /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/dynamic-content.php. Error message: Uncaught TypeError: substr(): Argument #1 ($string) must be of type string, array given in /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/dynamic-content.php:81
Stack trace:
#0 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/dynamic-content.php(81): substr()
#1 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Divi/dynamic-content.php(24): WPML\Compatibility\Divi\DynamicContent->is_dynamic_content()
#2 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/class-wp-hook.php(326): WPML\Compatibility\Divi\DynamicContent->decode_dynamic_content()
#3 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#4 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-shortcode-encoding.php(85): apply_filters()
#5 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-register-shortcodes.php(89): WPML_PB_Shortcode_Encoding->decode()
#6 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-shortcode-strategy.php(122): WPML_PB_Register_Shortcodes->register_shortcode_strings()
#7 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/strategy/shortcode/class-wpml-pb-shortcode-strategy.php(108): WPML_PB_Shortcode_Strategy->register_strings_in_content()
#8 [internal function]: WPML_PB_Shortcode_Strategy->register_strings()
#9 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Invoker/Invoker.php(41): call_user_func_array()
#10 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(162): WPML\FP\Invoker\_Invoker->__invoke()
#11 [internal function]: WPML\FP\Fns::WPML\FP\{closure}()
#12 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array()
#13 [internal function]: WPML\FP\{closure}()
#14 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(151): array_map()
#15 [internal function]: WPML\FP\Fns::WPML\FP\{closure}()
#16 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array()
#17 [internal function]: WPML\FP\Fns::WPML\FP\{closure}()
#18 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array()
#19 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(156): WPML\FP\Fns::__callStatic()
#20 [internal function]: WPML\FP\Fns::WPML\FP\{closure}()
#21 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(154): call_user_func_array()
#22 [internal function]: WPML\FP\Fns::WPML\FP\{closure}()
#23 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array()
#24 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/class-wpml-pb-integration.php(355): WPML\FP\Fns::__callStatic()
#25 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Shared/st/class-wpml-pb-integration.php(249): WPML_PB_Integration->with_strategies()
#26 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/class-wp-hook.php(324): WPML_PB_Integration->register_all_strings_for_translation()
#27 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#28 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()
#29 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/inc/translation-management/translation-management.class.php(1388): do_action()
#30 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/class-wpml-translation-job-factory.php(112): TranslationManagement->send_jobs()
#31 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php(164): WPML_Translation_Job_Factory->create_local_job()
#32 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/jobs/Manual.php(43): WPML\TM\Jobs\Manual->createLocalJob()
#33 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Either.php(207): WPML\TM\Jobs\Manual->createOrReuse()
#34 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/editor/Editor.php(103): WPML\FP\Right->map()
#35 /var/www/vhosts/cambratgn360.com/httpdocs/wp-content/plugins/sitepress-multilingual-cms/classes/menu/translation-queue/class-wpml-translations-queue.php(52): WPML\TM\Editor\Editor->open()
#36 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/class-wp-hook.php(324): WPML_Translations_Queue->load()
#37 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#38 /var/www/vhosts/cambratgn360.com/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()
#39 /var/www/vhosts/cambratgn360.com/httpdocs/wp-admin/includes/class-wp-screen.php(424): do_action()
#40 /var/www/vhosts/cambratgn360.com/httpdocs/wp-admin/includes/screen.php(243): WP_Screen->set_current_screen()
#41 /var/www/vhosts/cambratgn360.com/httpdocs/wp-admin/admin.php(213): set_current_screen()
#42 {main}
thrown
Andrey
WPML Supporter since 06/2013
Languages:
English (English )
Russian (Русский )
Timezone:
Europe/Kyiv (GMT+03:00)
Thank you for your feedback.
It looks like you're not using the latest version (the current 8.0.1 is from 11/19/2024). Please update the plugin to the latest 8.6.1 version.
Are you experiencing the error when you temporarily disable all plugins except WPML and WPBakery Page Builder to troubleshoot? What are the results?
emiliH
If I deactive Divi Builder it works fine. The problem is that I need to use both builders on my web.
Andrey
WPML Supporter since 06/2013
Languages:
English (English )
Russian (Русский )
Timezone:
Europe/Kyiv (GMT+03:00)
Thank you for your feedback.
I 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. When you log in to leave your next reply, you will find the needed fields below the comment area. The information you will enter is private, meaning only you and I can see and access it.
If I need to debug the problem further, I would like to ask if it's possible to replicate your site locally. I'll need to install a "Duplicator" temporarily or "All In One Migration" plugin on your site. This will allow me to create a copy of your site and your content. If you prefer to do it independently, you can provide the snapshot and send me the zipped package you downloaded.
Let me know how you feel about this.