From 9c9116921572bbacbc00ee2691854583103aee46 Mon Sep 17 00:00:00 2001 From: Jack Wilkinson <31214002+jaxwilko@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:15:28 +0100 Subject: [PATCH] Added a fix to ensure that all blocks are considered when use generating the cache key (#37) --- classes/BlocksDatasource.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/classes/BlocksDatasource.php b/classes/BlocksDatasource.php index a275f35..b1ea356 100644 --- a/classes/BlocksDatasource.php +++ b/classes/BlocksDatasource.php @@ -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() + ); } /**