function views_test_config_view_load

Same name in other branches
  1. 9 core/modules/views/tests/modules/views_test_config/views_test_config.module \views_test_config_view_load()
  2. 8.9.x core/modules/views/tests/modules/views_test_config/views_test_config.module \views_test_config_view_load()
  3. 10 core/modules/views/tests/modules/views_test_config/views_test_config.module \views_test_config_view_load()

Implements hook_ENTITY_TYPE_load().

File

core/modules/views/tests/modules/views_test_config/views_test_config.module, line 16

Code

function views_test_config_view_load(array $views) {
    // Emulate a severely broken view: this kind of view configuration cannot be
    // saved, it can likely be returned only by a corrupt active configuration.
    $broken_view_id = \Drupal::state()->get('views_test_config.broken_view');
    if (isset($views[$broken_view_id])) {
        $display =& $views[$broken_view_id]->getDisplay('default');
        $display['display_options']['fields']['id_broken'] = NULL;
    }
}

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