Skip to content
Snippets Groups Projects

Account for the possibility that there is no profile installed

1 file
+ 10
6
Compare changes
  • Side-by-side
  • Inline
+ 10
6
@@ -14,14 +14,18 @@ function lightning_core_requirements() {
$requirements = [];
$profile = Drupal::installProfile();
$profile = Drupal::service('extension.list.profile')->get($profile);
if ($profile) {
$profile = Drupal::service('extension.list.profile')->get($profile);
if (isset($profile->info['base profile'])) {
$requirements['lightning_core_base_profile'] = [
'title' => t('Base profile'),
'value' => $profile->info['base profile'],
];
if (isset($profile->info['base profile'])) {
$requirements['lightning_core_base_profile'] = [
'title' => t('Base profile'),
'value' => $profile->info['base profile'],
];
}
}
return $requirements;
}
Loading