Resolved
Reported for: WPML Multilingual CMS 4.5.7
Resolved in: 4.6.0
Overview of the issue
If you are running a server with PHP8, whenever you try to activate the Enable auto-updates option in Dashboard → Plugins, you will get the following error:
PHP Fatal error: Uncaught TypeError: array_diff(): Argument #2 must be of type array, bool given in …/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/upgrade/AutoUpgrade.php:39
Workaround
As a workaround:
- Go to Dashboard → Plugins.
- Disable WPML Multilingual CMS.
- Activate the Enable auto-updates option.
- Re-enable WPML.
Hi,
I am getting this error fatel the update wpml plugin, Can you please help me to find out this issue.
PHP message: Fatal error: Uncaught TypeError: array_diff(): Argument #1 ($array) must be of type array, bool given in /var/www/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-templates.php:176
Hey Vijay,
This error is different from the one reported here, could you please open a ticket in our support forum so we can investigate it?
Regards
Hello
I have the same error when i try to activate updraftplus on a clients website:
PHP Fatal error (TypeError) has occurred during save settings. Error Message: array_diff(): Argument #2 must be of type array, bool given (Code: 0, line 39 in /public_html/wp-content/plugins/sitepress-multilingual-cms/vendor/otgs/installer/includes/upgrade/AutoUpgrade.php)
How to fix this?
Hello Jelle,
Please try the workaround here presented. If this doesn’t help, open a ticket in our support forum so we can help you better.
Regard
Hello andres
I dont have auto update enabled so the work around does not worn for me. It just need to be fixed soon i gues. Its already an old issue…
Kind regards
Thank you, we will keep this erratum updated.
Any news on your “erratum”? I still have this problem, where can I activate the Enable auto-updates?
I’m afraid this issue is still valid. Enabling auto-updates is a WordPress feature available in the Plugins Dashboard, this link may help.
Otherwise, please open a ticket in our support forum so we can investigate your sitation.
Regards
Hi, I also have this problem.
I enabled the auto-update with add_filter( ‘auto_update_plugin’, ‘__return_true’ ); but the problem persists.
Hello there,
This workaround should work if the auto-update is enable from the Dashboard. However, please open a ticket in our support forum so we can investigate further your situation.
Regards
Hello, having same issue but slightly different. I DO NOT want to enable auto-update at all. Im just trying to make a setting change in Updraft and getting the same error. This did lead to try just to deactivate the CMS plugin temporarily and then just make the change I needed in Updraft. Reactivate the CMS. That worked for me.
Thank you for sharing your workaround!
We will keep this erratum updated.
I’m having the same issue. What I’ve done is to simply add these lines at the beginning of the function modifyAutoUpdatePluginsOption() in sitepress-multilingual-cms/vendor/otgs/installer/includes/upgrade/AutoUpgrade.php. I hope this is fixed soon.
if (!is_array($value))
$value = array();
if (!is_array($oldValue))
$oldValue = array();
Thank you for sharing Eric, we hope to release a definitive solution soon.
Regards
Hey everyone,
This issue should be solved with WPML 4.6.0