function common_test_module_implements_alter

Same name and namespace in other branches
  1. 7.x modules/simpletest/tests/common_test.module \common_test_module_implements_alter()
  2. 9 core/modules/system/tests/modules/common_test/common_test.module \common_test_module_implements_alter()
  3. 8.9.x core/modules/system/tests/modules/common_test/common_test.module \common_test_module_implements_alter()
  4. 10 core/modules/system/tests/modules/common_test/common_test.module \common_test_module_implements_alter()

Implements hook_module_implements_alter().

See also

block_drupal_alter_foo_alter()

File

core/modules/system/tests/modules/common_test/common_test.module, line 93

Code

function common_test_module_implements_alter(&$implementations, $hook) {
    // For
    // \Drupal::moduleHandler()->alter(array('drupal_alter', 'drupal_alter_foo'), ...),
    // make the block module implementations run after all the other modules. Note
    // that when \Drupal::moduleHandler->alter() is called with an array of types,
    // the first type is considered primary and controls the module order.
    if ($hook == 'drupal_alter_alter' && isset($implementations['block'])) {
        $group = $implementations['block'];
        unset($implementations['block']);
        $implementations['block'] = $group;
    }
}

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