Skip to content

Commit 9e16cc3

Browse files
committed
Fix theme pattern registration when theme is not defined
1 parent b846408 commit 9e16cc3

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/BlockPattern/Application/Services/PatternService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private function registerPatterns(): void
9090

9191
$theme = $this->themeService->theme();
9292

93-
if (! function_exists('get_stylesheet_directory')) {
93+
if (! function_exists('get_stylesheet_directory') || ! $theme) {
9494
return;
9595
}
9696

src/Discovery/Infrastructure/Services/DiscoveryEngine.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ private function discoverPaths(DiscoversPathInterface $discovery): void
240240

241241
/** @var SplFileInfo $file */
242242
foreach ($iterator as $file) {
243+
echo '<pre>';
244+
var_dump($file);
245+
echo '</pre>';
243246
if ($file->isFile()) {
244247
$discovery->discoverPath($location, $file->getPathname());
245248
}

0 commit comments

Comments
 (0)