Articles in this section

Unable to Copy Data in WP Toolkit with error: Argument #2 ($haystack) must be of type array, null given.

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Copying data in Plesk > WordPress > example.com > Copy Data provides an error that is similar to the following:

    CONFIG_TEXT: ERROR Data copy to WP installation completed (errors) example.com Copying of data from https://staging.example.com to https://www.example.com completed with the following issue: in_array(): Argument #2 ($haystack) must be of type array, null given.

  • In relation to this action, you may find the following entries in the /var/log/plesk/panel.log:

    CONFIG_TEXT: ERR [panel] Task failed: id=20196, pid=23107, type=ext-wp-toolkit-backgroundtasksimplementation\syncing\syncingtask, error=in_array(): Argument #2 ($haystack) must be of type array, null given, clientRemoteAddr=203.0.113.2, currentStepProgress=-1, currentStepText=, referrer=/modules/wp-toolkit/index.php/domain/list, restoreTargetMaintenanceMode=1, runTaskUnderLogin=example.com
    ERR [panel] TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given

Cause

This behavior is caused by a known WP Toolkit bug with ID #EXTWPTOOLK-10814 that affects WordPress Multisite installations.

The bug will be fixed in future versions of the WP Toolkit and can be tracked in the Change Log for Plesk Obsidian.

Resolution

Until the bug is fixed permanently, you may apply the following workaround:

1. Log into Plesk

2. Go to WordPress > example.com > Copy Data

4. In Choose database tables to copy, select the Selected tables option

5. Press on Select tables to copy

5. Check the boxes for the the exact database tables that you want to copy and press Select

4. Start the copying process by pressing Start

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.