Resolved
Reported for: WPML Multilingual CMS 4.5.5
Resolved in: 4.5.6
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.
-
- Open the /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/FusionBuilder/frontend/Hooks.php file.
- Look for line 102.
- Replace:
1
if
( Obj::prop(
'layout_conditions'
,
$data
) ) {
With:
1234if
(
is_string
(
$data
) && ( !
strpos
(
$data
,
'layout_conditions'
))) {
return
;
}
if
( Obj::prop(
'layout_conditions'
,
$data
) ) {