From 92e2dafedc29ecfd695d89e6c47caa34ee1040c6 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Wed, 24 Mar 2021 13:28:34 +0000 Subject: [PATCH] Issue #3205344 by alexpott: Calling system_requirements() can be expensive - do the cheap check first --- core/modules/system/src/Controller/SystemController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php index a04724fe804d..801c12c3aaaf 100644 --- a/core/modules/system/src/Controller/SystemController.php +++ b/core/modules/system/src/Controller/SystemController.php @@ -118,7 +118,7 @@ public static function create(ContainerInterface $container) { */ public function overview($link_id) { // Check for status report errors. - if ($this->systemManager->checkRequirements() && $this->currentUser()->hasPermission('administer site configuration')) { + if ($this->currentUser()->hasPermission('administer site configuration') && $this->systemManager->checkRequirements()) { $this->messenger()->addError($this->t('One or more problems were detected with your Drupal installation. Check the <a href=":status">status report</a> for more information.', [':status' => Url::fromRoute('system.status')->toString()])); } // Load all menu links below it. -- GitLab