You are here

function template_preprocess_dmu_report in Drupal 7 to 8/9 Module Upgrader 8

Template preprocessor.

Parameters

array $variables: Template variables.

File

./drupalmoduleupgrader.module, line 122
DMU module file.

Code

function template_preprocess_dmu_report(array &$variables) {
  $categories = \Drupal::config('drupalmoduleupgrader.tags')
    ->get('category');

  /** @var \Drupal\drupalmoduleupgrader\IssueInterface $issue */
  foreach ($variables['report']
    ->getIssues() as $issue) {
    $category = $categories[$issue
      ->hasTag('category') ? $issue
      ->getTag('category')[0] : 'misc'];
    $variables['issues'][$category][] = [
      '#theme' => 'dmu_issue',
      '#issue' => $issue,
    ];
  }
  ksort($variables['issues']);
}