From fdb266fc864635b50e25acf2d76ffecda5b10e57 Mon Sep 17 00:00:00 2001 From: Andrew Berry Date: Wed, 11 Sep 2024 15:47:24 -0400 Subject: [PATCH 1/2] Fix wrong path to composer.json for TwigExtension cs-fixer --- drainpipe-dev/scaffold/.twig-cs-fixer.dist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php b/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php index f4a8ad90..043fa9c2 100644 --- a/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php +++ b/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php @@ -37,7 +37,7 @@ $config->addTwigExtension(new TwigExtension($renderer, $urlGenerator, $themeManager, $dateFormatter, $fileUrlGenerator)); if (class_exists('\TwigStorybook\Twig\TwigExtension')) { - $composer_json = json_decode(file_get_contents(__DIR__ . '/../../../../composer.json'), true); + $composer_json = json_decode(file_get_contents(__DIR__ . '/composer.json'), true); if (json_last_error()) { throw new \RuntimeException('Could not parse composer.json'); } From d09ee62233da577f16cd6a554986f9c2e57aaea7 Mon Sep 17 00:00:00 2001 From: Andrew Berry Date: Wed, 11 Sep 2024 15:51:51 -0400 Subject: [PATCH 2/2] Fix extension call to match new library --- drainpipe-dev/scaffold/.twig-cs-fixer.dist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php b/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php index 043fa9c2..b76f4ab5 100644 --- a/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php +++ b/drainpipe-dev/scaffold/.twig-cs-fixer.dist.php @@ -43,7 +43,7 @@ } $web_root = $composer_json['extra']['drupal-scaffold']['locations']['web-root']; - $config->addExtension(new \TwigStorybook\Twig\TwigExtension(new \TwigStorybook\Service\StoryCollector(), '/../../../../' . $web_root)); + $config->addTwigExtension(new \TwigStorybook\Twig\TwigExtension(new \TwigStorybook\Service\StoryCollector(), __DIR__ . $web_root)); } return $config;