You are here

function lightning_scheduler_requirements in Lightning Workflow 8.2

Same name and namespace in other branches
  1. 8.3 modules/lightning_scheduler/lightning_scheduler.install \lightning_scheduler_requirements()

Implements hook_requirements().

File

modules/lightning_scheduler/lightning_scheduler.install, line 106

Code

function lightning_scheduler_requirements($phase) {
  $requirements = [];
  if ($phase === 'runtime') {
    $migrations = Drupal::service('lightning_scheduler.migrator')
      ->getMigrations();
    if ($migrations) {
      $requirements['lightning_scheduler_migrations'] = [
        'severity' => REQUIREMENT_INFO,
        'title' => t('Lightning Scheduler data migration'),
        'description' => t('Some content has not yet been migrated into the new base fields installed by Lightning Scheduler. Visit <a href=":url">this page</a> to migrate the data.', [
          ':url' => Url::fromRoute('lightning_scheduler.migrate')
            ->toString(),
        ]),
      ];
    }
  }
  return $requirements;
}