diff -u b/core/includes/install.inc b/core/includes/install.inc --- b/core/includes/install.inc +++ b/core/includes/install.inc @@ -981,16 +981,18 @@ if (isset($requirement['severity']) && $requirement['severity'] == REQUIREMENT_ERROR) { $message = []; - $message['description'] = [ - '#markup' => $requirement['description'], - '#weight' => 0, - ]; - - // If the requirement description is actually a render array, correct - // the message array to recognize this. + // If the requirement description is already a render array, add it + // to the message array. if (is_array($requirement['description'])) { $message['description'] = $requirement['description']; } + // Otherwise, add a #markup element for the description string. + else { + $message['description'] = ['#markup' => $requirement['description']]; + } + // Set the description weight to 0. If the description was previously + // a render array, we overwrite the existing weight here. + $message['description']['#weight'] = 0; // If a required value was provided for the item, add it to the error // message. See the hook_requirements() documentation. @@ -1002,8 +1004,7 @@ '#weight' => 1, ]; } - \Drupal::service('renderer')->renderPlain($message); - drupal_set_message($message, 'error'); + drupal_set_message(\Drupal::service('renderer')->renderPlain($message), 'error'); } } return FALSE;