Skip to content

Commit

Permalink
Added a fix to ensure that all blocks are considered when use generat…
Browse files Browse the repository at this point in the history
…ing the cache key (#37)
  • Loading branch information
jaxwilko authored Oct 25, 2024
1 parent 77a10aa commit 9c91169
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion classes/BlocksDatasource.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ class BlocksDatasource extends Datasource
public function __construct()
{
$this->processor = new BlockProcessor();
$this->blocks = BlockManager::instance()->getRegisteredBlocks();
$this->blocks = array_merge(
// Get blocks registered via plugins
BlockManager::instance()->getRegisteredBlocks(),
// Get blocks existing in the autodatasource
BlockManager::instance()->getBlocks()->map(function ($block) {
return ['name' => $block->name, 'path' => $block->getFilePath()];
})->pluck('path', 'name')->toArray()
);
}

/**
Expand Down

0 comments on commit 9c91169

Please sign in to comment.