You are here

function feeds_update_6012 in Feeds 7

Same name and namespace in other branches
  1. 6 feeds.install \feeds_update_6012()

Drop schedule table and reschedule all tasks, install Job Scheduler module.

File

./feeds.install, line 525
Schema definitions install/update/uninstall hooks.

Code

function feeds_update_6012() {
  $ret = array();

  // Only attempt installation if module is present, otherwise we would leave
  // the system table in a limbo.
  $modules = module_rebuild_cache();
  if (isset($modules['job_scheduler'])) {
    if (!$modules['job_scheduler']->status) {
      drupal_install_modules(array(
        'job_scheduler',
      ));
      drupal_set_message(t('Installed Job Scheduler module.'));
    }
  }
  else {
    drupal_set_message(t('NOTE: Please install new dependency of Feeds: !job_scheduler module.', array(
      '!job_scheduler' => l(t('Job Scheduler'), 'http://drupal.org/project/job_scheduler'),
    )), 'warning');
  }
  db_drop_table($ret, 'feeds_schedule');
  feeds_reschedule(TRUE);
  return $ret;
}