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

Smarty Errors #308

Closed
solcre opened this issue Oct 19, 2016 · 5 comments
Closed

Smarty Errors #308

solcre opened this issue Oct 19, 2016 · 5 comments

Comments

@solcre
Copy link

solcre commented Oct 19, 2016

Hi, we have been using smarty for about 9 years, and when we had errors on a tpl smarty usually raised an fatal error indicating the problem. Now we updated to latest version and when an error is found, smarty renders the last working version for that tpl from cache (templates_c).

How can we get the old behavior?

Steps to reproduce:

1- Create a tpl with "blah blah"
2- Render the tpl
3- Make a change on the tpl with a syntax error.
4- Try to render de tpl and you will see that it is rendering: "blah blah".

@uwetews
Copy link
Contributor

uwetews commented Oct 20, 2016

What is the setting of Smarty::$compile_check?
Did you change your system time so that the time stamps of the compiled template files in template_c no longer correspond to the template sources.
Is the time stamp of the modified source newer as the time stamp as the corresponding compiled file in template_c?
Did you delete all existing files in the template_c and cache folder after the upgrade?
If you delete all files in template_c, can you reproduce the problem?

As last test install the master branch version because a couple of bug fixes.

@solcre
Copy link
Author

solcre commented Oct 20, 2016

Hi @uwetews, $compile_check is set to true.

No time change in my system.

Investigating further more I realized the following:

1- Create a tpl with "blah blah"
2- Render the tpl
3- Make a change on the tpl with a syntax error.
4- Try to render de tpl and you will see that it is rendering: "blah blah".
*5- The mtime of the compiled template, is modified (same as the last access to the page), but with exactly the same contents for the file. *

Looks like if there was a "touch" on the compiled template.

The header of the compiled template is:

  • Smarty version 3.1.30, created on 2016-10-20 10:59:43

While the stat of the file is:

stat 76dcd329204f62c838837d6df3358e9d1a51a54d_0.file.main.tpl.php
File: `76dcd329204f62c838837d6df3358e9d1a51a54d_0.file.main.tpl.php'
Size: 6166 Blocks: 16 IO Block: 4096 regular file
Device: ca21h/51745d Inode: 7416297 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 622/mcdiaf16) Gid: ( 634/mcdiaf16)
Access: 2016-10-20 11:04:14.000000000 -0300
Modify: 2016-10-20 11:02:42.000000000 -0300
Change: 2016-10-20 11:02:42.000000000 -0300

If I fix the syntax error, it will re-compile the tpl and everything works and the header of the compiled template is now:

/* Smarty version 3.1.30, created on 2016-10-20 11:08:20

This is driving me mad. Any hints ?
I'm using: 3.1.30 you think it is necessary to pull from master ?

uwetews added a commit that referenced this issue Oct 21, 2016
@uwetews
Copy link
Contributor

uwetews commented Oct 21, 2016

It was indeed a bug.
The fix is now i the master branch

@uwetews uwetews closed this as completed Oct 21, 2016
@solcre
Copy link
Author

solcre commented Oct 24, 2016

I'm glad it is fixed now!

@solcre
Copy link
Author

solcre commented Oct 25, 2016

I'n glad it's fixed! Later!

El Thursday, October 20, 2016, uwetews notifications@github.com escribió:

It was indeed a bug.
The fix is now i the master branch


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#308 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEtHDn9UHTAUpKldmIYt_AF7uoIZwV5Wks5q2B0JgaJpZM4KbkoN
.

[image: Solcre Technology Solutions]

Matias Fuster Coll
Solcre Technology Solutions
www.solcre.com
+598 2706 9927
Ing. Luis P. Ponce 1443A
11602 Montevideo, Uruguay

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

No branches or pull requests

2 participants