diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index d0c0a6fbb2a..54bdc5270d2 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -15,6 +15,7 @@ use Drupal\Core\KeyValueStore\KeyValueStoreExpirableInterface; use Drupal\Core\Render\Element; use Drupal\Core\Session\AccountInterface; +use Drupal\system\SystemManager; use Drupal\user\PermissionHandlerInterface; use Drupal\Core\Url; use Drupal\system\ModuleDependencyMessageTrait; @@ -133,6 +134,13 @@ public function buildForm(array $form, FormStateInterface $form_state) { require_once DRUPAL_ROOT . '/core/includes/install.inc'; $distribution = drupal_install_profile_distribution_name(); + $requirements = \Drupal::service('system.manager')->listRequirements(); + if (array_intersect_key($requirements, array_flip(['module_core_incompatible', 'module_php_incompatible', 'invalid_module']))) { + $this->messenger()->addWarning(t( + 'There are errors with your modules please visit the status report page', + [':link' => Url::fromRoute('system.status')->toString()] + )); + } // Include system.admin.inc so we can use the sort callbacks. $this->moduleHandler->loadInclude('system', 'inc', 'system.admin');