You are here

function rich_snippets_update_7100 in Rich Snippets 7

Remove the bad date formats discovered in issue #1874416.

File

./rich_snippets.install, line 27
Install, update, and uninstall functions for the Rich Snippets module.

Code

function rich_snippets_update_7100() {

  // Update the variables to point to the new, correct values.
  variable_set('date_format_rich_snippets_event_date', 'D, M j, Y');
  variable_set('date_format_rich_snippets_published_date', 'M j, Y');

  // Delete the bad formats from the database.
  db_delete('date_formats')
    ->condition('type', 'rich_snippets_published_date')
    ->condition('format', 'M t, Y')
    ->execute();
  db_delete('date_formats')
    ->condition('type', 'rich_snippets_event_date')
    ->condition('format', 'D, M t, Y')
    ->execute();
}