Guides & TutorialsTroubleshootingCommon ErrorsTroubleshooting Dataset must be an array in /vendor/whmcs/whmcs-foundation/lib/TableQuery.php

Troubleshooting Dataset must be an array in /vendor/whmcs/whmcs-foundation/lib/TableQuery.php

Symptom

You may encounter the following error when viewing lists of clients, services, addons, or domains in the Admin Area:

InvalidArgumentException: Dataset must be an array in /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/TableQuery.php:0
Stack trace:
#0 /path/to/whmcs/vendor/whmcs/whmcs-foundation/lib/TableModel.php(0): WHMCS\TableQuery->setData(NULL)

Cause

The expected $mysql_charset value is incorrectly defined in the configuration.php file, preventing the system from successfully interpreting data from the MySQL® database.

Solution

To resolve this issue:

1. Edit the configuration.php file in your WHMCS directory.

2. Add the following entry if it is not present:

$mysql_charset = 'utf8';

3. If the following entry is present, remove it:

$mysql_charset = 'latin1';

4. Save the file.