You are here

function lightning_scheduler_requirements in Lightning Workflow 8.3

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

Implements hook_requirements().

File

modules/lightning_scheduler/lightning_scheduler.install, line 121
Contains installation and update hooks for Lightning Scheduler.

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;
}