{"action":"created","issue":{"url":"https://api.github.com/repos/bolt/bolt/issues/4290","repository_url":"https://api.github.com/repos/bolt/bolt","labels_url":"https://api.github.com/repos/bolt/bolt/issues/4290/labels{/name}","comments_url":"https://api.github.com/repos/bolt/bolt/issues/4290/comments","events_url":"https://api.github.com/repos/bolt/bolt/issues/4290/events","html_url":"https://github.com/bolt/bolt/issues/4290","id":112158047,"number":4290,"title":"Twig complains about templates not being defined","user":{"login":"hannesl","id":254634,"avatar_url":"https://avatars.githubusercontent.com/u/254634?v=3","gravatar_id":"","url":"https://api.github.com/users/hannesl","html_url":"https://github.com/hannesl","followers_url":"https://api.github.com/users/hannesl/followers","following_url":"https://api.github.com/users/hannesl/following{/other_user}","gists_url":"https://api.github.com/users/hannesl/gists{/gist_id}","starred_url":"https://api.github.com/users/hannesl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannesl/subscriptions","organizations_url":"https://api.github.com/users/hannesl/orgs","repos_url":"https://api.github.com/users/hannesl/repos","events_url":"https://api.github.com/users/hannesl/events{/privacy}","received_events_url":"https://api.github.com/users/hannesl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bolt/bolt/labels/Bug%20verification%20needed","name":"Bug verification needed","color":"d4c5f9"},{"url":"https://api.github.com/repos/bolt/bolt/labels/%C2%AF%5C_(%E3%83%84)_/%C2%AF","name":"¯\\_(ツ)_/¯","color":"DDDDDD"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-19T14:35:06Z","updated_at":"2016-04-04T07:48:48Z","closed_at":"2016-04-04T07:48:48Z","body":"This is a tricky one that is hard to reproduce. I don't know when or why the problem occurs, but it happens from time to time, seemingly by random.\r\n\r\nThe problem is that sometimes the site ends up in a state where the Frontend templates are not found by Twig:\r\n\r\n    Symfony\\Component\\HttpKernel\\Exception\\HttpException: Rendering homepage failed: Template \"index.twig\" is not defined.\r\n\r\nClearing the cache fixes it, always.\r\n\r\nI've nailed it down somewhat:\r\n\r\n* It only happens if you put your templates in a subdirectory of your theme.\r\n* The reason the templates aren't found is because the `theme` configuration isn't available. `$app['config']->get('theme')` returns nothing. This means there is no `template_directory` variable available. Twig is instead handed the root theme path, which doesn't contain any templates in this case. (See `Bolt\\Configuration\\ResourceManager::postInitialize()`.)\r\n* The cached configuration in `config_cache.php` does not contain the theme configuration, so the problem persists until the cache is cleared.\r\n\r\nI've installed Bolt as a Composer project if that makes a difference."},"comment":{"url":"https://api.github.com/repos/bolt/bolt/issues/comments/205178381","html_url":"https://github.com/bolt/bolt/issues/4290#issuecomment-205178381","issue_url":"https://api.github.com/repos/bolt/bolt/issues/4290","id":205178381,"user":{"login":"SahAssar","id":5096632,"avatar_url":"https://avatars.githubusercontent.com/u/5096632?v=3","gravatar_id":"","url":"https://api.github.com/users/SahAssar","html_url":"https://github.com/SahAssar","followers_url":"https://api.github.com/users/SahAssar/followers","following_url":"https://api.github.com/users/SahAssar/following{/other_user}","gists_url":"https://api.github.com/users/SahAssar/gists{/gist_id}","starred_url":"https://api.github.com/users/SahAssar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SahAssar/subscriptions","organizations_url":"https://api.github.com/users/SahAssar/orgs","repos_url":"https://api.github.com/users/SahAssar/repos","events_url":"https://api.github.com/users/SahAssar/events{/privacy}","received_events_url":"https://api.github.com/users/SahAssar/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T07:48:48Z","updated_at":"2016-04-04T07:48:48Z","body":"Alright, then I'm closing this for now... If anyone runs into again it feel free to reopen, and if that person also finds a way to reliably reproduce it would be even better :)"}}