HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
2021.009 - Fatal Error in Twig\Loader\FilesystemLoader.findTemplate();
hynsey
New
I get this message when opening home page after copying all files across (am upgrading from 3.2):
Unable to find template "C:/inetpub/vhosts/mickhynes.com/forum.dartman.online/library/Vanilla/Web/Asset/AssetPreloadModel.twig" (looked into: C:\Inetpub\vhosts\mickhynes.com\forum.dartman.online).
The error occurred on or near: C:\inetpub\vhosts\mickhynes.com\forum.dartman.online\vendor\twig\twig\src\Loader\FilesystemLoader.php
246: if (!$throw) { 247: return false; 248: } 249: 250: throw new LoaderError($this->errorCache[$name]); 251: } 252: 253: private function normalizeName($name) 254: {
Additional information for support personnel:
- Application: Vanilla
- Application Version: 2021.009
- PHP Version: 7.4.27
- Operating System: WINNT
- Server Software: Microsoft-IIS/10.0
- User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36
- Request Uri: /
- Controller: Twig\Loader\FilesystemLoader
- Method: findTemplate
Can anyone help please?
Thanks!
0
Comments
If you try to run this on Windows with IIS, you need to know IIS good enough to help yourself. There are not many discussions dealing with that topic here and I do not know if they are helpful
Thanks. I feel someone may be able to help. The file specified is in the location specified, and the IIS app pool has full access to that folder.
I've managed to fix this. To anyone else running it on Windows, it seems to be how paths are being presented. I can't vouch for long-term viability of this solution, but it fixed my situation. In the
findTemplate
function in the/vendor/twig/twig/src/Loader/Filesystemloader.php
file, I commented out the lines below and replaced with new ones (essentially just use$shortname
instead of combining it with$path
).$shortname
contained the full path to the file already in some (but not all) cases - so the function now handles both.