diff --git a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php index 5974ef3db..e1d21d418 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php +++ b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php @@ -12,6 +12,7 @@ namespace Thelia\Core\Template\Smarty\Assets; +use Symfony\Component\Finder\Finder; use Thelia\Log\Tlog; use Thelia\Tools\URL; use Thelia\Core\Template\Assets\AssetManagerInterface; @@ -142,8 +143,14 @@ class SmartyAssetsManager } $url = ""; + // test if file exists before running the process - if (file_exists($assetSource . DS . $file)) { + $finder = new Finder(); + + $files = $finder->files()->in($assetSource)->name($file); + + if (! empty($files)) { + $url = $this->assetsManager->processAsset( $assetSource . DS . $file, $assetSource . DS . self::$assetsDirectory, @@ -156,6 +163,9 @@ class SmartyAssetsManager $debug ); } + else { + Tlog::getInstance()->addError("Asset $assetSource".DS."$file was not found."); + } return $url; }