Drupal 7 has a new and efficient way of loading module and theme settings from the database. The new loader requires all settings to be stored in the current (serialized) format.

An unfortunate side effect is that any left-over settings from modules that did not clean up when they were uninstalled, and are not stored in the correct format, cause PHP notices on your site.

This may happen if you've for instance upgraded a site from Drupal 5, through Drupal 6 to Drupal 7.

You cannot turn these notices off, as the setting that controls whether errors and notices are displayed on the site is itself a variable that needs to be loaded from the database before it can be applied.

This module lists all entries in the {variable} table that cause unwanted PHP notices on production sites, such as:

Notice: unserialize() [function.unserialize]: Error at offset 74 of 75 bytes in variable_initialize() (line 935 of /includes/bootstrap.inc).

By knowing the offending variable name, you can remove it from the database, making the notice go away. Of course, you should probably notify the module or theme author that their module or theme does not properly clean up after itself.

If you find a variable that causes a problem, please note it in a comment on #1284364: Use variable_initialize() against broken values - Notice: unserialize() [function.unserialize]: .

Related Modules

  • Variable Cleanup — Checks for unused variables in your variable table by scanning your entire filesystem for unused variables.
  • Variable debug — Gives some insight into the memory used by variables and links to Drupal.org issues for some of them. It can also guesstimate which variables are orphaned by comparing them to the name of installed modules.

#D8UX: I promise I will never create a Drupal 8 version of this module

Supporting organizations: 

Project Information

Downloads