Skip to content

Commit a8196b3

Browse files
authored
Cache management should base on the templateId
fix compile error ```shell php bin/console smarty:compile 18:45:49 CRITICAL [console] Error thrown while running command "smarty:compile". Message: "Illegal offset type in isset or empty" ["exception" => TypeError { …},"command" => "smarty:compile","message" => "Illegal offset type in isset or empty"] In TemplateLoader.php line 77: Illegal offset type in isset or empty smarty:compile [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<bundle>] ```
1 parent 206befc commit a8196b3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/Loader/TemplateLoader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ public function load($name)
7171
{
7272
$templateId = $name instanceof TemplateReferenceInterface ? $name->getLogicalName() : $name;
7373

74-
if (isset($this->cache[$name])) {
75-
return $this->cache[$name];
74+
if (isset($this->cache[$templateId])) {
75+
return $this->cache[$templateId];
7676
}
7777

7878
$template = $name instanceof TemplateReferenceInterface ? $name : $this->defaultTemplateParser->parse($name);

0 commit comments

Comments
 (0)