You are here

function quotes_update_6107 in Quotes 6

Implementation of hook_update_N(). See http://drupal.org/node/601434.

File

./quotes.install, line 512
Handles installation and updates for the quotes module.

Code

function quotes_update_6107() {
  $ret = array();
  if (db_column_exists('quotes_blocks', 'view_weight')) {
    db_drop_field($ret, 'quotes_blocks', 'view_weight');
  }

  // Let's see if any blocks use "plain" title.
  $result = db_query('SELECT bid, name, show_titles FROM {quotes_blocks} WHERE show_titles = 2');
  while ($row = db_fetch_object($result)) {
    if ($row->show_titles == 2) {
      drupal_set_message(t("The @block_name block will be changed to show titles linked to the node.", array(
        '@block_name' => $row->name,
      )));
    }
  }
  $ret[] = update_sql("UPDATE {quotes_blocks} SET show_titles = 1 WHERE show_titles = 2");
  return $ret;
}