If no blocks have been exported and you try to import blocks, the following error occurs:

[error] TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 348 of /var/www/html/web/modules/contrib/structure_sync/src/Controller/BlocksController.php) #0 /var/www/html/web/modules/contrib/structure_sync/src/Controller/BlocksController.php(348): count()

#1 /var/www/html/web/modules/contrib/structure_sync/src/Controller/BlocksController.php(159): Drupal\structure_sync\Controller\BlocksController::importBlocksSafe()

CommentFileSizeAuthor
#2 typerror_no_blocks_3497649.patch560 bytesduttonma
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

duttonma created an issue. See original summary.

duttonma’s picture

Status: Active » Needs review
StatusFileSize
new560 bytes

Patch attached to fix this issue

mparker17 made their first commit to this issue’s fork.

mparker17’s picture

Version: 2.0.8 » 2.x-dev
Assigned: duttonma » Unassigned
Priority: Normal » Major
Issue tags: +Needs tests

To make this easier to review, I've created a merge request.

A brief glance at the code in the merge request suggests that it has no tests. The Structure Sync maintainers prefer to accept merge requests that have passing automated tests. If you need help writing tests, please ask: I would be happy to help!