Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught --> Smarty: Unable to write file [file_path] thrown in C:\[project_path]\vendor\smarty\smarty\src\Smarty.php on line 1732 #1018

Closed
rodriguezny opened this issue May 21, 2024 · 7 comments · Fixed by #1056

Comments

@rodriguezny
Copy link

rodriguezny commented May 21, 2024

We are facing this issue in the project Tiki Wiki CMS only for windows users.
The following error is thrown:
Fatal error: Uncaught --> Smarty: unable to write file C:\xampp\htdocs\tiki\temp\templates_c\en_basic^f4976e02395559add3c9bc302b01cf84441c25a1_0.extends_layout_view.tpl|tiki-show_page.tpl.php <-- thrown in C:\xampp\htdocs\tiki1\tiki\vendor_bundled\vendor\smarty\smarty\src\Smarty.php on line 1724

I took a look in the file smarty/smarty/src/Smarty.php from line 1697 and found some comments and an if{} close related to Windows which is supposed to handle windows case, but it seems it doesn't solve windows issue.
We already tried to set the directory permission recursively to 777 but the error still persists.
Thanks!

@rodriguezny rodriguezny changed the title Fatal error: Uncaught --> Smarty :Unable to write file [file_path] thrown in C:\[project_path]\vendor\smarty\smarty\src\Smarty.php on line 1732 Fatal error: Uncaught --> Smarty: Unable to write file [file_path] thrown in C:\[project_path]\vendor\smarty\smarty\src\Smarty.php on line 1732 May 21, 2024
@wisskid
Copy link
Contributor

wisskid commented May 23, 2024

I suppose the | character in the filename that is illegal on Windows. I noticed it today in another issue too.

@rodriguezny
Copy link
Author

I suppose the | character in the filename that is illegal on Windows. I noticed it today in another issue too.

But the | character comes from the template inheritance when extending resource type.

@wisskid
Copy link
Contributor

wisskid commented May 29, 2024

Yes, I didn't mean to say it was your fault. I suppose the |-character was somehow encoded in v4 and we "simplified" that a bit too much in v5. The unit tests didn't catch it since they always run on Linux.

@rodriguezny
Copy link
Author

Yes, I didn't mean to say it was your fault. I suppose the |-character was somehow encoded in v4 and we "simplified" that a bit too much in v5. The unit tests didn't catch it since they always run on Linux.

Ok, I understand. So do we have to wait for the fix ?

@wisskid
Copy link
Contributor

wisskid commented May 29, 2024

Yes, but maybe you can help me find the source of the bug?
I noticed that the filenames have indeed changed between v4 and v5:

  • In v4, \ExtendsResourceTest::testCompileBlockIncreaseInChild_050 results in a compiled template named "./tests/UnitTests/ResourceTests/Extends/templates_c/210f746458dbb237333807da8d80ff53a837985c_0.extends.050_grandchild.tpl.php".
  • In v5, it's "./tests/UnitTests/ResourceTests/Extends/templates_c/0a382e517fefa510de3f987160291ed9924a7124_0.extends_050_parent.tpl|050_child.tpl|050_grandchild.tpl.php".

@rodriguezny
Copy link
Author

rodriguezny commented Jun 3, 2024

Yes, but maybe you can help me find the source of the bug? I noticed that the filenames have indeed changed between v4 and v5:

  • In v4, \ExtendsResourceTest::testCompileBlockIncreaseInChild_050 results in a compiled template named "./tests/UnitTests/ResourceTests/Extends/templates_c/210f746458dbb237333807da8d80ff53a837985c_0.extends.050_grandchild.tpl.php".
  • In v5, it's "./tests/UnitTests/ResourceTests/Extends/templates_c/0a382e517fefa510de3f987160291ed9924a7124_0.extends_050_parent.tpl|050_child.tpl|050_grandchild.tpl.php".

Ok, I'll try to find the source of the bug. Sorry for answering later.

@JordanViknar
Copy link

Just wanted to mention I can confirm I'm encountering the same error on an internal company project I'm currently upgrading as part of an internship.

In the mean time, I have downgraded Smarty to v4 (still a big upgrade compared to the outdated version it was using), but would like a fix before my internship ends if possible.

Thank you in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants