From c0c9ebc78b022ce9ebcef3ab422140e6a9fc1c05 Mon Sep 17 00:00:00 2001 From: Jack Wilkinson Date: Thu, 29 Aug 2024 16:52:14 +0100 Subject: [PATCH] Added a fix to ensure that all blocks are considered when use generating the cache key --- 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() + ); } /**