navigation.install

Same filename in other branches
  1. 10 core/modules/navigation/navigation.install

Install, update and uninstall functions for the navigation module.

File

core/modules/navigation/navigation.install

View source
<?php


/**
 * @file
 * Install, update and uninstall functions for the navigation module.
 */

/**
 * Implements hook_requirements().
 */
function navigation_requirements($phase) {
    $requirements = [];
    if ($phase === 'runtime') {
        if (\Drupal::moduleHandler()->moduleExists('toolbar')) {
            $requirements['toolbar'] = [
                'title' => t('Toolbar and Navigation modules are both installed'),
                'value' => t('The Navigation module is a complete replacement for the Toolbar module and disables its functionality when both modules are installed. If you are planning to continue using Navigation module, you can uninstall the Toolbar module now.'),
                'severity' => REQUIREMENT_WARNING,
            ];
        }
    }
    return $requirements;
}

/**
 * Reorganizes the values for the logo settings.
 */
function navigation_update_11001(array &$sandbox) : void {
    $settings = \Drupal::configFactory()->getEditable('navigation.settings');
    $settings->setData([
        'logo' => [
            'provider' => $settings->get('logo_provider'),
            'managed' => $settings->get('logo_managed'),
            'max' => [
                'filesize' => $settings->get('logo_max_filesize'),
                'height' => $settings->get('logo_height'),
                'width' => $settings->get('logo_width'),
            ],
        ],
    ]);
    $settings->save(TRUE);
}

Functions

Title Deprecated Summary
navigation_requirements Implements hook_requirements().
navigation_update_11001 Reorganizes the values for the logo settings.

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