You are here

function mailhandler_update_6212 in Mailhandler 6.2

Change feed config from 'mailbox' to 'source'.

File

./mailhandler.install, line 483
Install, update and uninstall functions for the Mailhandler module.

Code

function mailhandler_update_6212() {
  $ret = array();
  $result = db_query('SELECT * FROM {feeds_source}');
  while ($row = db_fetch_array($result)) {
    $row['config'] = unserialize($row['config']);
    if (isset($row['config']['MailhandlerFetcher']['mailbox'])) {
      $row['config']['MailhandlerFetcher']['source'] = $row['config']['MailhandlerFetcher']['mailbox'];
      unset($row['config']['MailhandlerFetcher']['mailbox']);
      drupal_write_record('feeds_source', $row, array(
        'id',
        'feed_nid',
      ));
    }
  }
  return $ret;
}