From 7c0a5aa0fed75f30bb21555cddc4c745b1096f2d Mon Sep 17 00:00:00 2001 From: Falmesino Abdul Hamid Date: Tue, 5 Dec 2023 02:43:31 +0700 Subject: [PATCH] fix: check if the config directory exists This fix an error of unable to find config file in windows. ``` Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("The "C:/laragon/www/boltprojectname/config/extensions\bolt-boltforms\" directory does not exist."). Symfony\Component\Finder\Exception\DirectoryNotFoundException: The "C:/laragon/www/boltprojectname/config/extensions\bolt-boltforms\" directory does not exist. ``` --- src/BoltFormsConfig.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/BoltFormsConfig.php b/src/BoltFormsConfig.php index 33f3ee3..baecee4 100644 --- a/src/BoltFormsConfig.php +++ b/src/BoltFormsConfig.php @@ -71,6 +71,10 @@ private function getAdditionalFormConfigs(): array { $configPath = explode('.yaml', $this->getExtension()->getConfigFilenames()['main'])[0] . DIRECTORY_SEPARATOR; + if (!is_dir($configPath)) { + return []; + } + $finder = new Finder(); $finder->files()->in($configPath)->name('*.yaml');