You are here

function legal_update_7103 in Legal 7

Set format column of existing T&Cs to Plain Text, or to default if Plain Text doesn't exist.

File

./legal.install, line 177
Installation and update functions for the Legal module.

Code

function legal_update_7103() {
  $formats = filter_formats();
  if (isset($formats['plain_text'])) {
    $format = 'plain_text';
  }
  else {
    $format = filter_fallback_format();
  }
  db_update('legal_conditions')
    ->fields(array(
    'format' => $format,
  ))
    ->condition('format', NULL)
    ->execute();
}