function template_preprocess_update_version

Same name in other branches
  1. 9 core/modules/update/update.report.inc \template_preprocess_update_version()
  2. 10 core/modules/update/update.report.inc \template_preprocess_update_version()
  3. 11.x core/modules/update/update.report.inc \template_preprocess_update_version()

Prepares variables for update version templates.

Default template: update-version.html.twig.

Parameters

array $variables: An associative array containing:

  • version: An array of information about the release version.

File

core/modules/update/update.report.inc, line 115

Code

function template_preprocess_update_version(array &$variables) {
    $version = $variables['version'];
    if (empty($version['core_compatibility_message'])) {
        return;
    }
    $core_compatible = !empty($version['core_compatible']);
    $variables['core_compatibility_details'] = [
        '#type' => 'details',
        '#title' => $core_compatible ? t('Compatible') : t('Not compatible'),
        '#open' => !$core_compatible,
        'message' => [
            '#markup' => $version['core_compatibility_message'],
        ],
        '#attributes' => [
            'class' => [
                $core_compatible ? 'compatible' : 'not-compatible',
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.