From ac74a8e4d4d7b8d331dd94d1c4b7b975a11bc98b Mon Sep 17 00:00:00 2001 From: Daniel Richardt Date: Tue, 15 Oct 2019 16:55:00 +0200 Subject: [PATCH] Fix bundle template override in Symfony 4.3 --- Locator/FileLocator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Locator/FileLocator.php b/Locator/FileLocator.php index 3b9ecf9..9dfc35d 100644 --- a/Locator/FileLocator.php +++ b/Locator/FileLocator.php @@ -131,7 +131,7 @@ public function locate($name, $dir = null, $first = true) $this->setCurrentTheme($theme, $this->activeTheme->getDeviceType()); } - if ('@' === $name[0]) { + if ('@' === $name[0] || 0 === strpos($name, 'views/@')) { return $this->locateBundleResource($name, $this->path, $first); } @@ -164,7 +164,7 @@ protected function locateBundleResource($name, $dir = null, $first = true) throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name)); } - $bundleName = substr($name, 1); + $bundleName = substr(str_replace('views/', '', $name), 1); $path = ''; if (false !== strpos($bundleName, '/')) { list($bundleName, $path) = explode('/', $bundleName, 2);