View previous topic :: View next topic |
Author |
Message |
artvolk Smarty Regular
Joined: 09 Dec 2009 Posts: 45
|
Posted: Fri Nov 12, 2010 10:18 am Post subject: $error_reporting is not processed in 3.0-Release |
|
|
Hallo!
I used to use latest /trunk of Smarty 3.0 and I use this:
Code: |
// When set, smarty does uses this value as error_reporting-level.
public $error_reporting = null;
|
It seems that in release this check is missing:
Code: |
if (isset($this->error_reporting)) {
$_smarty_old_error_level = error_reporting($this->error_reporting);
}
|
So this option has no effect.
Am I the first one with bug report for release? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Nov 12, 2010 11:55 am Post subject: |
|
|
Hi
This is not a bug. The error_reporting property has been dropped in Smarty3. It does not really make sense any longer to you different reporting levels for Smarty as in your application.
If you rellay need some thing different you can set the error reporting level in your application before calling Smarty. |
|
Back to top |
|
matsberg Smarty n00b
Joined: 12 Nov 2010 Posts: 4 Location: Sweden
|
Posted: Fri Nov 12, 2010 12:01 pm Post subject: |
|
|
U.Tews wrote: | Hi
This is not a bug. The error_reporting property has been dropped in Smarty3. It does not really make sense any longer to you different reporting levels for Smarty as in your application.
If you rellay need some thing different you can set the error reporting level in your application before calling Smarty. |
I think it was better before, i do want notices enabled for the rest of my site but not for my templates as there is a lot of undefineds in the templates as it is for now.
If i disable error reporting before calling smarty i will not get reporting in any subsequent code. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Fri Nov 12, 2010 12:43 pm Post subject: |
|
|
I agree with U. Tews: you should handle error reporting on your own.
If you have "subsequent code" (In my applications something like $smarty->display() is almost always the last line of the outermost called php-file)
you can easily restore error_reporting after calling Smarty::display().
(U Tews.: congrats to the 3.0-release, btw ) |
|
Back to top |
|
matsberg Smarty n00b
Joined: 12 Nov 2010 Posts: 4 Location: Sweden
|
Posted: Fri Nov 12, 2010 1:16 pm Post subject: |
|
|
messju wrote: |
If you have "subsequent code" (In my applications something like $smarty->display() is almost always the last line of the outermost called php-file)
you can easily restore error_reporting after calling Smarty::display().
|
Since i use quite a number of templates on every page its not an option.
I also use smarty to generate XML and other stuff, so i really need the notices where they are needed (outside smarty).
In V2 it worked just fine.
In V3 dev it worked fine. Then it suddenly stopped working and we were given the error_reporting variabe to set the flags, with was fine.
Now the only option is to disable error_reporting everytime i access the smarty object, unless i want to tamper with hundreds of smarty calls in my code. |
|
Back to top |
|
artvolk Smarty Regular
Joined: 09 Dec 2009 Posts: 45
|
Posted: Fri Nov 12, 2010 2:28 pm Post subject: |
|
|
Here are some thoughts:
- My code is developed with all possible error reporting, but templates are ported from 2.0 (where checking for variable in the way {if $variable}) was really common).
- There are situations where Smarty is used more that once during one page hit. For example we use Smarty for multiple e-mail templates before rendering the actual page using Smarty.
- It's breaking change at least for those who used /trunk and betas is it possible to mention it in README?
- The variable $error_reporting left in source, but is not used. Is this intentional?
About this issue -- the only way I see for myself is to apply local patch, but this is what most of us like to avoid.
Anyway I'm happy about release! At least I can remove svn:externals pointing to smarty repository from my projects |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Nov 12, 2010 2:39 pm Post subject: |
|
|
The idea behind removing error_reporting: all E_NOTICE situations in Smarty templates have been addressed. When you set an error_reporting level in templates, this also affects all plugins/filters/etc. So it should be possible to use the PHP-level error_reporting for templates now, and clean up any E_NOTICE situations in your own code.
However, it appears there are situations where users still want a separate error_reporting level for templates. We will restore error_reporting in the engine, but default will be the PHP error_reporting level. You will need to change this yourself. |
|
Back to top |
|
artvolk Smarty Regular
Joined: 09 Dec 2009 Posts: 45
|
Posted: Fri Nov 12, 2010 2:40 pm Post subject: |
|
|
Is this the same behaviour as in /trunk before release? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Nov 12, 2010 4:01 pm Post subject: |
|
|
artvolk wrote: | Is this the same behaviour as in /trunk before release? |
yes, same as RC4 |
|
Back to top |
|
artvolk Smarty Regular
Joined: 09 Dec 2009 Posts: 45
|
Posted: Fri Nov 12, 2010 4:01 pm Post subject: |
|
|
Thanks, this change will be in release available for download or in SVN? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Nov 12, 2010 4:05 pm Post subject: |
|
|
already released 3.0.1. |
|
Back to top |
|
matsberg Smarty n00b
Joined: 12 Nov 2010 Posts: 4 Location: Sweden
|
Posted: Fri Nov 12, 2010 4:06 pm Post subject: |
|
|
artvolk wrote: | Thanks, this change will be in release available for download or in SVN? |
It seems to be fixed in SVN already.
Thank you!!!! |
|
Back to top |
|
|