solspace / craft-freeform

Freeform for Craft: The most reliable form builder that's ready for wherever your project takes you.
https://docs.solspace.com/craft/freeform/v5/
Other
48 stars 61 forks source link

Twig Template Loading Error on Windows Server #1331

Closed briancnoble closed 6 months ago

briancnoble commented 6 months ago

What happened?

We are using the Formatting templates from using the {{ freeform.form.render() }} tag. This error does not happen locally because we are running on Linux servers locally. Only happens on the Windows servers we use for hosting the website

Additional Thoughts

  1. Seeing freeform prepended to the template path example: freeformE:\B2b-Craft\vendor\solspace\craft-freeform\packages\plugin\src\templates\_templates\formatting\tailwind-3\index.twig

  2. Could be an issue with the template paths specified on the template selector in the admin

CleanShot 2024-06-04 at 12 20 43

Errors and Stack Trace (if available)

craft\web\twig\TemplateLoaderException: Unable to find the template “freeformE:\B2b-Craft\vendor\solspace\craft-freeform\packages\plugin\src\templates\_templates\formatting\tailwind-3\index.twig”. in E:\B2b-Craft\templates\_includes\components\blocks\freeform-form\index.twig:47
Stack trace:
#0 E:\B2b-Craft\vendor\craftcms\cms\src\web\twig\TemplateLoader.php(69): craft\web\twig\TemplateLoader->_resolveTemplate()
#1 E:\B2b-Craft\vendor\twig\twig\src\Environment.php(264): craft\web\twig\TemplateLoader->getCacheKey()
#2 E:\B2b-Craft\vendor\twig\twig\src\Environment.php(312): Twig\Environment->getTemplateClass()
#3 E:\B2b-Craft\vendor\twig\twig\src\Environment.php(280): Twig\Environment->load()
#4 E:\B2b-Craft\vendor\craftcms\cms\src\web\View.php(482): Twig\Environment->render()
#5 E:\B2b-Craft\vendor\solspace\craft-freeform\packages\plugin\src\Services\FormsService.php(362): craft\web\View->renderTemplate()
#6 E:\B2b-Craft\vendor\solspace\craft-freeform\packages\plugin\src\Form\Form.php(602): Solspace\Freeform\Services\FormsService->renderFormTemplate()
#7 E:\B2b-Craft\vendor\twig\twig\src\Extension\CoreExtension.php(1635): Solspace\Freeform\Form\Form->render()
#8 E:\B2b-Craft\vendor\craftcms\cms\src\helpers\Template.php(151): twig_get_attribute()
#9 E:\B2b-Craft\storage\runtime\compiled_templates\15\1512806b036d5b8602e6a30c28e375e5.php(102): craft\helpers\Template::attribute()
#10 E:\B2b-Craft\vendor\twig\twig\src\Template.php(394): __TwigTemplate_670aaed8f74632b02fd919d3a3c6672e->doDisplay()
#11 E:\B2b-Craft\vendor\twig\twig\src\Template.php(367): Twig\Template->displayWithErrorHandling()
#12 E:\B2b-Craft\storage\runtime\compiled_templates\33\338efac1eef9276c237164ef6e9b8791.php(152): Twig\Template->display()
#13 E:\B2b-Craft\vendor\twig\twig\src\Template.php(171): __TwigTemplate_8faa3a5753a7a62c0913a3f30b017a81->block_main()
#14 E:\B2b-Craft\storage\runtime\compiled_templates\1f\1f539784a8492b7604010582fa081bf6.php(73): Twig\Template->displayBlock()
#15 E:\B2b-Craft\vendor\twig\twig\src\Template.php(394): __TwigTemplate_f594cb31c84e6d9ada23f8104cb442e1->doDisplay()
#16 E:\B2b-Craft\vendor\twig\twig\src\Template.php(367): Twig\Template->displayWithErrorHandling()
#17 E:\B2b-Craft\storage\runtime\compiled_templates\33\338efac1eef9276c237164ef6e9b8791.php(43): Twig\Template->display()
#18 E:\B2b-Craft\vendor\twig\twig\src\Template.php(394): __TwigTemplate_8faa3a5753a7a62c0913a3f30b017a81->doDisplay()
#19 E:\B2b-Craft\vendor\twig\twig\src\Template.php(367): Twig\Template->displayWithErrorHandling()
#20 E:\B2b-Craft\vendor\twig\twig\src\Template.php(379): Twig\Template->display()
#21 E:\B2b-Craft\vendor\twig\twig\src\TemplateWrapper.php(38): Twig\Template->render()
#22 E:\B2b-Craft\vendor\twig\twig\src\Environment.php(280): Twig\TemplateWrapper->render()
#23 E:\B2b-Craft\vendor\craftcms\cms\src\web\View.php(482): Twig\Environment->render()
#24 E:\B2b-Craft\vendor\craftcms\cms\src\web\View.php(535): craft\web\View->renderTemplate()
#25 E:\B2b-Craft\vendor\craftcms\cms\src\web\TemplateResponseFormatter.php(57): craft\web\View->renderPageTemplate()
#26 E:\B2b-Craft\vendor\yiisoft\yii2\web\Response.php(1100): craft\web\TemplateResponseFormatter->format()
#27 E:\B2b-Craft\vendor\craftcms\cms\src\web\Response.php(338): yii\web\Response->prepare()
#28 E:\B2b-Craft\vendor\yiisoft\yii2\web\Response.php(340): craft\web\Response->prepare()
#29 E:\B2b-Craft\vendor\yiisoft\yii2\base\Application.php(390): yii\web\Response->send()
#30 E:\B2b-Craft\web\index.php(22): yii\base\Application->run()
#31 {main}

How can we reproduce this?

  1. Use the {{ form.render() }} tag on the template
  2. Be on a Windows Server
  3. Go to the url that loads the form template

Freeform Edition

Pro

Freeform Version

5.3.3

Craft Version

4.9.7

When did this issue start?

After upgrading from older Freeform version

Previous Freeform Version

5.2.0

kjmartens commented 6 months ago

Sorry for the trouble @briancnoble,

Can you try updating to Freeform 5.3.3.1+ and see if it resolves this issue? :)

briancnoble commented 6 months ago

@kjmartens Thanks that update seemed to fix the error. The forms are loading correctly now