Problem/Motivation
SQLSTATE[42000]: Syntax error or access violation: 1064 is triggered when we pass empty array with name to readMultiple method, when trying to get information about setting.
I hit a case where I pass empty array to this method and SQL error is thrown.
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1: SELECT "name", "data" FROM "config" WHERE "collection" = :collection AND "name" IN ( ); Array ( [:collection] => ) in Drupal\Core\Config\DatabaseStorage->readMultiple() (line 115 of core/lib/Drupal/Core/Config/DatabaseStorage.php).
Steps to reproduce
Inject config.storage.active into a class (as it is not public you should not be able to use \Drupal::service('config.storage.active')
Call $active_storage->readMultiple([]);
Proposed resolution
First check if the value is not empty, otherwise return empty array.
Remaining tasks
Review