function rules_menu_get_item_alter

Implements hook_menu_get_item_alter().

File

./rules.module, line 34

Code

function rules_menu_get_item_alter() {
    // Make sure that event invocation is enabled before menu items are loaded.
    // But make sure later calls to menu_get_item() won't automatically re-enabled
    // the rules invocation.
    // Example: modules that implement hook_entity_ENTITY_TYPE_load() might want
    // to invoke Rules events in that load hook, which is also invoked for menu
    // item loading. Since this can happen even before hook_init() we need to make
    // sure that firing Rules events is enabled at that point. A typical use case
    // for this is Drupal Commerce with commerce_cart_commerce_order_load().
    if (!drupal_static('rules_init', FALSE)) {
        rules_event_invocation_enabled(TRUE);
    }
}