Skip to content

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

@nstriedinger

Description

@nstriedinger

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);
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions