upgrade_status.module in Upgrade Status 8
File
upgrade_status.module
View source
<?php
use Drupal\Core\Routing\RouteMatchInterface;
function upgrade_status_help($route_name, RouteMatchInterface $route_match) {
if ($route_name == 'upgrade_status.report') {
return '<p>' . t('Analyze your site\'s Drupal 9 readiness. Run the report to find out if there are detectable compatibility errors with the modules and themes installed on your site. <a href=":prepare">Read more about preparing your site for Drupal 9</a>.', [
':prepare' => 'https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/prepare-a-drupal-8-site-for-drupal-9',
]) . '</p>';
}
}
function upgrade_status_theme($existing, $type, $theme, $path) {
return [
'upgrade_status_html_export' => [
'variables' => [
'projects' => [],
],
],
'upgrade_status_ascii_export' => [
'variables' => [
'projects' => [],
],
],
'upgrade_status_summary_counter' => [
'variables' => [
'summary' => [],
],
],
];
}
function template_preprocess_upgrade_status_html_export(&$variables) {
$projects = $variables['projects'];
$types = [
'custom',
'contrib',
];
foreach ($types as $type) {
if (!empty($projects[$type])) {
foreach ($projects[$type] as $key => $project) {
$variables['projects'][$type][$key]['name'] = $projects[$type][$key]['#title'];
}
}
}
}
function template_preprocess_upgrade_status_ascii_export(&$variables) {
template_preprocess_upgrade_status_html_export($variables);
}