“Notice: Undefined index” quick fix in Drupal 7 error reporting

In drupal 7 , the error reporting settings in php.ini is overridden by the bootstrap sequence. Even you changed your site’s htaccess settings, it won’t work as drupal forces you to use E_ALL.

As result some modules may produce undefined variables that will be displayed as messages “Notice: Undefined index” or “Notice: Undefined variable” and your logs will grow insanely.

The quick solution is to add in your settings.php the following line:

ini_set('error_reporting', 'E_ALL ^ E_NOTICE');
Advertisements

2 thoughts on ““Notice: Undefined index” quick fix in Drupal 7 error reporting

  1. I see a lot of interesting posts on your website.

    You have to spend a lot of time writing, i know how to save you a lot of work, there is a tool that creates unique, SEO friendly articles in couple of minutes, just search in google – k2 unlimited content

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s