config_schema_test.module

Same filename in other branches
  1. 9 core/modules/config/tests/config_schema_test/config_schema_test.module
  2. 10 core/modules/config/tests/config_schema_test/config_schema_test.module
  3. 11.x core/modules/config/tests/config_schema_test/config_schema_test.module

Tests configuration schema functionality.

File

core/modules/config/tests/config_schema_test/config_schema_test.module

View source
<?php


/**
 * @file
 * Tests configuration schema functionality.
 */

/**
 * Implements hook_config_schema_info_alter().
 */
function config_schema_test_config_schema_info_alter(&$definitions) {
    if (\Drupal::state()->get('config_schema_test_exception_add')) {
        $definitions['config_schema_test.hook_added_definition'] = $definitions['config_schema_test.hook'];
    }
    if (\Drupal::state()->get('config_schema_test_exception_remove')) {
        unset($definitions['config_schema_test.hook']);
    }
    // Since code can not be unloaded only alter the definition if it exists.
    if (isset($definitions['config_schema_test.hook'])) {
        $definitions['config_schema_test.hook']['additional_metadata'] = 'new schema info';
    }
}

Functions

Title Deprecated Summary
config_schema_test_config_schema_info_alter Implements hook_config_schema_info_alter().

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