WPML
Status
Resolved
Reported for
WPML Multilingual CMS 4.5.5
Resolved in
4.5.6
Related plugin/theme
Avada

Overview of the issue

In some scenarios, if you are using the WooCommerce products shortcode, you will get this error:

PHP Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in …wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:110

Workaround

Please be sure to make a full backup of your site before proceeding.



    1. Open the /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/FusionBuilder/frontend/Hooks.php file.

    2. Look for line 102.

    3. Replace:
      		if ( Obj::prop( 'layout_conditions', $data ) ) {

      With:

      		if ( is_string($data) && ( !strpos($data, 'layout_conditions'))) {
      			return;
      		}
      		if ( Obj::prop( 'layout_conditions', $data ) ) {


 

All known issues →