You are here

function metatag_update_7008 in Metatag 7

Remove any empty records that may be hanging around from old releases.

File

./metatag.install, line 1052
Install, update, and uninstall functions for the metatag module.

Code

function metatag_update_7008() {
  $conditions = db_or()
    ->isNull('data')
    ->condition('data', '')
    ->condition('data', serialize(array()));
  $deleted = db_delete("metatag")
    ->condition($conditions)
    ->execute();
  if ($deleted > 0) {
    drupal_set_message(t('Purged @count empty meta tag record(s).', array(
      '@count' => $deleted,
    )));
  }
}