diff -u b/core/modules/update/src/ProjectCoreCompatibility.php b/core/modules/update/src/ProjectCoreCompatibility.php --- b/core/modules/update/src/ProjectCoreCompatibility.php +++ b/core/modules/update/src/ProjectCoreCompatibility.php @@ -162,40 +162,19 @@ * @see static::createMessageFromCoreCompatibility() */ protected function createCoreCompatibilityDetails($core_compatible, $core_compatibility_range) { - $element = [ + return [ '#type' => 'details', - 'compatibility_range' => [ + '#title' => $core_compatible ? $this->t('Compatible') : $this->t('Not compatible'), + '#open' => !$core_compatible, + 'message' => [ '#markup' => $core_compatibility_range, ], - ]; - if ($core_compatible) { - $element += [ - '#title' => $this->t('Compatible'), - '#open' => FALSE, - ]; - $compatibility_intro = $this->t('Your version of Drupal core (%version) is compatible with this update.', ['%version' => $this->existingCoreVersion]); - } - else { - $element += [ - '#title' => $this->t('Not compatible'), - '#open' => TRUE, - ]; - $compatibility_intro = $this->t('Your version of Drupal core (%version) is not compatible with this update.', ['%version' => $this->existingCoreVersion]); - } - $element += [ - 'intro' => [ - '#weight' => -10, - '#markup' => $compatibility_intro, - '#prefix' => '

', - '#suffix' => '

', - ], '#attributes' => [ 'class' => [ $core_compatible ? 'compatible' : 'not-compatible', ], ], ]; - return $element; } /**