You are here

function domain_conf_get_menu_parents in Domain Access 7.3

Same name and namespace in other branches
  1. 7.2 domain_conf/domain_conf.module \domain_conf_get_menu_parents()

Form process function to load available menus.

If we try to load the menus in the batch hook, it can create a race condition with menu_rebuild() that leads to a fatal call stack error.

So we use this process callback to populate the menus safely, after they have been rebuilt.

1 string reference to 'domain_conf_get_menu_parents'
domain_conf_domain_batch in domain_conf/domain_conf.domain.inc
Implements hook_domain_batch().

File

domain_conf/domain_conf.domain.inc, line 436
Domain hooks for Domain Conf.

Code

function domain_conf_get_menu_parents($element, &$form_state) {
  static $options;
  if (!isset($options)) {
    $options = menu_parent_options(menu_get_menus(), array(
      'mlid' => 0,
    ));
  }
  $element['#options'] += $options;
  return $element;
}