[ThemeBundle] Fix warmup process to not to miss theme templates

This commit is contained in:
aramalipoor 2015-12-22 11:53:46 +03:30 committed by Kamil Kokot
parent 19b7990335
commit 63c30c352a
2 changed files with 4 additions and 6 deletions

View file

@ -153,6 +153,7 @@
"sylius/taxation-bundle": "self.version",
"sylius/taxonomy": "self.version",
"sylius/taxonomy-bundle": "self.version",
"sylius/theme-bundle": "self.version",
"sylius/translation": "self.version",
"sylius/translation-bundle": "self.version",
"sylius/user": "self.version",

View file

@ -73,18 +73,15 @@ class TemplatePathsCacheWarmer extends CacheWarmer
/** @var TemplateReferenceInterface $template */
foreach ($this->finder->findAllTemplates() as $template) {
$this->themeContext->clear();
$templates[$template->getLogicalName()] = $this->locator->locate($template);
foreach ($themes as $theme) {
$this->themeContext->setTheme($theme);
$path = $this->locator->locate($template);
if ($path !== $templates[$template->getLogicalName()]) {
$templates[$template->getLogicalName() . "|" . $theme->getLogicalName()] = $path;
}
$templates[$template->getLogicalName() . "|" . $theme->getLogicalName()] = $path;
}
$templates[$template->getLogicalName()] = $this->locator->locate($template);
}
$this->writeCacheFile($cacheDir . '/templates.php', sprintf('<?php return %s;', var_export($templates, true)));