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
  • Loading branch information
jaxwilko committed Aug 29, 2024
1 parent 4b7d476 commit c0c9ebc
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 c0c9ebc

Please sign in to comment.