Resolved
Reported for: WPML Multilingual CMS 4.4.6
Resolved in: WPML 4.4.8
Overview of the issue
If you go to the Customizer or Widgets page in your site’s admin, a blank page or fatal error is shown:
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:97
Workaround
- Make a full backup of your site before proceeding.
- Open the file /wp-content/plugins/sitepress-multilingual-cms/classes/widgets/class-wpml-widgets-support-backend.php.
- Change:
'selected_language' => Obj::propOr( 'all', 'wpml_language', $instance ),
- To:
'selected_language' => Obj::propOr( 'all', 'wpml_language', is_array( $instance ) ? $instance : [] ),
- Edit your Customizer options and/or widgets.
- When done editing, remove the code added in step 2.
- Open the file: wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php
- Change:
$post_types = get_post_types( $args, 'objects' ); foreach ( $post_types as $name => $attrs ) { $slug = trim( Obj::pathOr( '', [ 'rewrite', 'slug' ], $attrs ), '/' ); if ( $slug && isset( $vars[ $slug ] ) ) { $post_type = $name; $post_slug = $vars[ $slug ]; break; } }
- To:
$post_types = get_post_types( $args, 'objects' ); foreach ( $post_types as $name => $attrs ) { if ( $attrs->rewrite == false ) { break; } $slug = trim( Obj::pathOr( '', [ 'rewrite', 'slug' ], $attrs ), '/' ); if ( $slug && isset( $vars[ $slug ] ) ) { $post_type = $name; $post_slug = $vars[ $slug ]; break; } }
Not working on 4.4.7
Commetning Out Line 97 works at the moment but I hope you guys can find a proper solution for it. Thanks
Please check the updated workaround.
Our developers are working on resolving the issue.
Funny.. I didn’t have get this error until i installed 4.4.7.. Rolled back to 4.4.6 to fix.
I’m getting this exact error after upgrading to 4.4.7 today. In 4.4.6, everything worked fine.
Adding
if (is_string($item)) { return null; }
did *not* fix the problem.gettype($item)
shows it’s a boolean!After adding
if (is_bool($item)) { return null; }
, my site works again, but I don’t know if this doesn’t break something else…Please check the updated workaround.
Our developers are working on resolving the issue.
Still getting the error
Hello,
I upgraded all my WPML components this morning. I have now the following error : Fatal error: Uncaught Exception: item should be a Collection or an array or an object
Just wanted to chime in that after updating to 4.4.7 I am also receiving this critical error which takes down the front end of the site.
Rolling back to 4.4.6 solved it.
Will wait for confirmation that this is resolved before updating further.
Sorry for that – we are working on a permanent fix and it’ll be released as soon as it passes tests.
… same problem with 4.4.7
Sorry for that – we are working on a permanent fix and it’ll be released as soon as it passes tests.
downgraded to 4.4.6. Sent debug info in the support chat. I couldn’t update only ONE page – my homepage – updating all other pages worked fine.
We will soon have a fix for this issue.
Hi, we have this in combination with RankMath & WPML Plugin enabled – on edit/saving post/pages:
PHP Fatal error: Uncaught InvalidArgumentException: item should be a Collection or an array or an object in /web/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Obj.php:97
Sorry for that – we are working on a permanent fix and it’ll be released as soon as it passes tests.
Same here, i got this error after update to 4.4.7 today. Have to roll back to 4.4.6
Sorry for that – we are working on a permanent fix and it’ll be released as soon as it passes tests.
Yes, this fixed my issue. Thank you very much for the prompt reply.
I have the same error as well.
I imagine that this can help you solve the issue:
Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, Dynamic Content for Elementor.
First, visit your website (https://xxx.ch/) and check for any visible issues. Next, visit the page where the error was caught (https://xxx.ch/wp-admin/admin-ajax.php) and check for any visible issues.
Please contact your host for assistance with investigating this issue further.
If your site appears broken and you can’t access your dashboard normally, WordPress now has a special “recovery mode”. This lets you safely login to your dashboard and investigate further.
https://xxx.ch/wp-login.php?action=enter_recovery_mode&rm_token=5fwkIrBjH7pEY3in2AruZu&rm_key=lPHHFFEL6tb2qst3H8ea7D
To keep your site safe, this link will expire in 1 day. Don’t worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 5.5.3
Current theme: Hello Elementor Child (version 1.0.1) Current plugin: Dynamic Content for Elementor (version 1.9.6.7.2) PHP version 7.4.13
Error Details
=============
An error of type E_ERROR was caused in line 4 of the file /home/yyy/www/xxx.ch/wp-content/plugins/dynamic-content-for-elementor/includes/compatibility/wpml/widgets/class-WPML-AnimateText.php. Error message: Uncaught Error: Class ‘WPML_Elementor_Module_With_Items’ not found in /home/yyy/www/xxx.ch/wp-content/plugins/dynamic-content-for-elementor/includes/compatibility/wpml/widgets/class-WPML-AnimateText.php:4
Stack trace:
#0 /home/yyy/www/xxx.ch/wp-content/plugins/dynamic-content-for-elementor/includes/compatibility/wpml/class-DCE-WPML.php(63): require_once()
#1 /home/yyy/www/xxx.ch/wp-content/plugins/dynamic-content-for-elementor/includes/compatibility/wpml/class-DCE-WPML.php(50): DynamicContentForElementor\Compatibility\DCE_WPML->load_wpml_compatibility_classes()
#2 /home/yyy/www/xxx.ch/wp-content/plugins/dynamic-content-for-elementor/core/DCE_Plugin.php(138): DynamicContentForElementor\Compatibility\DCE_WPML->__construct()
#3 /home/yyy/www/xxx.ch/wp-content/plugins/dynamic-content-for-elementor/core/DCE_Plugin.php(39): DynamicContentForElementor\DCE_Plugin->init_components()
#4 /home/yyy/www/xxx.ch/wp-content/plugins/dynamic-content-for-elemento
Hello there,
This issue should have been solved with out latest version WPML 4.4.8. Could you please make a full backup of your site and update all your WPML package?
Regards
… our problem is solved with today updated wpml version 4.4.8
Thanks for the support and update!
Thank you for the confirmation! 🙂
Sorry for the inconveniences in the meantime.
Regards
SAMME HEREEE , I roll back to 446 :/
Hello there,
This issue should have been solved with out latest version WPML 4.4.8. Could you please make a full backup of your site and update all your WPML package?
Sorry for the inconveniences.
Regards