drush_cmi_tools icon indicating copy to clipboard operation
drush_cmi_tools copied to clipboard

Argument 2 passed to Drupal\config\StorageReplaceDataWrapper::replaceData() must be of the type array, boolean given,...

Open nstriedinger opened this issue 8 years ago • 1 comments

This was totally my fault, as I somehow generated an empty config file, but prompted me to include this to debug my issue. Thoughts on checking '$file_storage->read($name)' for 'false'?

  foreach ($file_storage->listAll() as $name) {
    $data = $file_storage->read($name);
    if (is_bool($data)){
      return drush_log(dt("Array expected, but a boolean was received in $name"), LogLevel::ERROR);
    }
    $source_storage->replaceData($name, $data);
  }

nstriedinger avatar Feb 20 '17 21:02 nstriedinger

Sure, PRs always welcome

larowlan avatar Feb 20 '17 22:02 larowlan