I just discovered something today that should interest lots of people :P Did you know Drupal saves each notice and error in his report logs ? If you have a custom script that generates for example 1000 notices, Drupal does 1000 notice database inserts before you get results. The script execution will never fail and you won’t be warned of these.
Notice examples:
1 2 |
Notice: Undefined index: ... in ... on line ... Notice: Undefined variable: ... in ... on line ... |
Of course, you tell me: “Why don’t you just disable notices ?” Yeah I did it since the beginning but Drupal 7 bootstrap override all your settings you’ve made from server and scripts.
I tried this php.ini setting , not working
1 |
error_reporting = E_ALL & ~E_NOTICE |
I tried this in script headers , not working either
1 |
error_reporting(0) |
Finally, the only way to get rid of them is to put this magical line into your /drupalroot/sites/default/settings.php
1 |
ini_set('error_reporting', 'E_ALL ^ E_NOTICE'); |
Just because E_ALL will be set by default in PHP 6, Drupal don’t want to use your server settings…
Check your Drupal report log messages guyz, you could be surprised ;)
Recent Comments