Waiting for author
Overview of the issue
If you try to translate an Element created with Avada library from WPML > Translation Management page, you will find the following PHP error:
PHP Fatal error: Uncaught Error: Call to a member function get_source_language_code() on bool in .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/tm/inc/functions-load.php:496 Stack trace: #0 [internal function]: wpml_tm_create_ATE_job_creation_model() #1 .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Fns.php(164): array_map() #2 [internal function]: WPML\FP\Fns::WPML\FP\{closure}() #3 .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/functions.php(152): call_user_func_array() #4 [internal function]: WPML\FP\Fns::WPML\FP\{closure}() #5 .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/collect/src/Illuminate/Support/Traits/Macroable.php(56): call_user_func_array() #6 .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/tm/classes/ATE/Hooks/class-wpml-tm-ate-jobs-actions.php(141): WPML\FP\Fns::__callStatic() #7 .../wp-incl in .../wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/tm/inc/functions-load.php on line 496
Workaround
Please, make sure of having a full backup of your site before proceeding.
- Open …/wp-content/plugins/fusion-builder/inc/class-fusion-builder-library.php file.
- Change:
add_action( 'wp_loaded', [ $this, 'register_layouts' ] );
- For
add_action( 'init', [ $this, 'register_layouts' ] );