Skip Navigation

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 DashboardPlugins, 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:

  1. Go to DashboardPlugins.
  2. Disable WPML Multilingual CMS.
  3. Activate the Enable auto-updates option.
  4. Re-enable WPML.

15 Responses to “PHP8 - Fatal error: Uncaught TypeError: array_diff(): Argument #2 must be of type array”

  1. 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

  2. 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?

  3. 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

    • 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

  4. 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

  5. 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.

  6. 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();